/* 用户端「详细订单」页（#orders）的私有样式。
 *
 * 为什么单独一个文件：
 *   · 页面是 2026-11-12 新增的独立工作区视图，不进 research-styles.css 的
 *     切片链（那条链要重建 52132 行 bundle，代价与风险都远大于收益）；
 *   · 它的类名全部带 yo- 前缀，不与全局样式冲突，也不需要改任何既有 CSS。
 *
 * 依赖：Bootstrap 5 的 .card / .btn / .form-control / .badge 等基础类
 *      （index.html 已加载 bootstrap.min.css）。
 */

.yo-card {
  border-radius: 14px;
}

.yo-card > .card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.yo-identity {
  font-size: var(--ds-fs-hint, 12px);
  color: var(--ds-text-muted, #6b7280);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .08);
  color: #4f46e5;
  font-weight: 500;
}

.yo-identity.is-guest {
  background: rgba(245, 158, 11, .12);
  color: #b45309;
}

/* ---- 子页签（订单 / 积分明细 / 凭证查询） ---- */

.yo-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(0, 0, 0, .07);
  margin-bottom: 16px;
}

.yo-subtab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ds-text-muted, #6b7280);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}

.yo-subtab:hover {
  color: #4f46e5;
  background: rgba(99, 102, 241, .06);
}

.yo-subtab.is-active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  font-weight: 600;
}

/* ---- 统计条 ---- */

.yo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.yo-stat {
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.yo-stat__label {
  font-size: 12px;
  color: var(--ds-text-muted, #6b7280);
  margin-bottom: 3px;
}

.yo-stat__value {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.2;
  word-break: break-all;
}

.yo-stat__value.is-danger { color: #dc2626; }
.yo-stat__value.is-success { color: #16a34a; }
.yo-stat__value.is-warn { color: #d97706; }

/* ---- 筛选栏 ---- */

.yo-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.yo-filters .form-control,
.yo-filters .form-select {
  font-size: 13px;
  border-radius: 8px;
}

.yo-filters__search {
  min-width: 220px;
  flex: 1 1 220px;
}

.yo-filters .form-select {
  width: auto;
  min-width: 116px;
}

/* ---- 订单卡 ---- */

.yo-order {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
}

.yo-order.is-failed {
  border-color: rgba(220, 38, 38, .3);
  background: rgba(254, 242, 242, .35);
}

.yo-order__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.yo-order__title {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  flex: 1 1 240px;
  min-width: 0;
  word-break: break-word;
}

.yo-order__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ds-text-muted, #6b7280);
  word-break: break-all;
}

.yo-order__badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.yo-tag {
  display: inline-block;
  font-size: 11px;
  line-height: 1.6;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(107, 114, 128, .1);
  color: #4b5563;
  white-space: nowrap;
}

.yo-tag--danger { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.yo-tag--success { background: rgba(22, 163, 74, .12); color: #15803d; }
.yo-tag--warn { background: rgba(217, 119, 6, .14); color: #b45309; }
.yo-tag--info { background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.yo-tag--muted { background: rgba(107, 114, 128, .12); color: #4b5563; }

.yo-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 4px 14px;
  font-size: 13px;
}

.yo-kv__row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.yo-kv__k {
  color: var(--ds-text-muted, #6b7280);
  flex: 0 0 auto;
}

.yo-kv__v {
  min-width: 0;
  word-break: break-all;
}

.yo-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .07);
  overflow: hidden;
  margin-top: 4px;
}

.yo-progress__bar {
  height: 100%;
  background: #4f46e5;
  border-radius: 999px;
}

.yo-order__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, .08);
}

.yo-refunds {
  margin-top: 10px;
  border: 1px solid rgba(217, 119, 6, .25);
  background: rgba(255, 251, 235, .6);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
}

.yo-refunds__title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---- 表格（积分码 / 流水） ---- */

.yo-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 10px;
}

.yo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

.yo-table th,
.yo-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  vertical-align: top;
  word-break: break-word;
}

.yo-table th {
  background: rgba(249, 250, 251, .9);
  font-weight: 600;
  white-space: nowrap;
  color: #374151;
}

.yo-table tbody tr:last-child td {
  border-bottom: 0;
}

.yo-table__num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.yo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

/* ---- 凭证查询 ---- */

.yo-query {
  border: 1px solid rgba(79, 70, 229, .18);
  background: rgba(99, 102, 241, .04);
  border-radius: 12px;
  padding: 14px;
}

.yo-query__hint {
  font-size: 12.5px;
  color: #4f46e5;
  margin-bottom: 10px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.yo-query__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.yo-query__field label {
  display: block;
  font-size: 12px;
  color: var(--ds-text-muted, #6b7280);
  margin-bottom: 4px;
}

.yo-query__result {
  margin-top: 14px;
}

.yo-section {
  margin-top: 14px;
}

.yo-section__title {
  font-size: 13px;
  font-weight: 650;
  color: #374151;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- 空态 / 错误 ---- */

.yo-empty {
  text-align: center;
  padding: 34px 16px;
  color: var(--ds-text-muted, #6b7280);
}

.yo-empty__icon {
  font-size: 30px;
  opacity: .45;
  margin-bottom: 8px;
}

.yo-empty__title {
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.yo-empty__desc {
  font-size: 13px;
  max-width: 460px;
  margin: 0 auto 12px;
}

.yo-alert {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.yo-alert--error {
  background: rgba(254, 242, 242, .9);
  border: 1px solid rgba(220, 38, 38, .3);
  color: #b91c1c;
}

.yo-alert--info {
  background: rgba(239, 246, 255, .9);
  border: 1px solid rgba(37, 99, 235, .25);
  color: #1d4ed8;
}

.yo-alert--warn {
  background: rgba(255, 251, 235, .9);
  border: 1px solid rgba(217, 119, 6, .3);
  color: #b45309;
}

.yo-skeleton {
  height: 78px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .04) 25%, rgba(0, 0, 0, .08) 37%, rgba(0, 0, 0, .04) 63%);
  background-size: 400% 100%;
  animation: yo-shimmer 1.3s ease infinite;
}

@keyframes yo-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---- 分页 ---- */

.yo-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ds-text-muted, #6b7280);
}

/* ---- 详情抽屉 ---- */

.yo-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 1080;
}

.yo-drawer-backdrop.is-open {
  opacity: 1;
}

.yo-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, .18);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 1081;
  display: flex;
  flex-direction: column;
}

.yo-drawer.is-open {
  transform: translateX(0);
}

.yo-drawer__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.yo-drawer__title {
  font-weight: 650;
  font-size: 15px;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.yo-drawer__close {
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 6px;
  border-radius: 6px;
}

.yo-drawer__close:hover {
  background: rgba(0, 0, 0, .05);
}

.yo-drawer__body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.yo-drawer__group {
  margin-bottom: 16px;
}

.yo-drawer__group-title {
  font-size: 12px;
  font-weight: 650;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

/* ---- 退款申请弹层 ---- */

.yo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.yo-modal {
  background: #fff;
  border-radius: 14px;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}

.yo-modal__head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  font-weight: 650;
}

.yo-modal__body {
  padding: 16px;
}

.yo-modal__foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, .08);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.yo-modal label {
  display: block;
  font-size: 12.5px;
  color: #4b5563;
  margin-bottom: 4px;
}

.yo-modal .form-control,
.yo-modal textarea {
  font-size: 13.5px;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .yo-filters__search { min-width: 100%; }
  .yo-drawer { width: 100%; }
  .yo-kv { grid-template-columns: 1fr; }
}

/* ---- 面板占满整行时的左边距（2026-11-14）----
 *
 * 症状：订单明细页右侧被裁掉 —— 「刷新」「清空」按钮只露一半，卡片里的
 * 创建/支付时间列和右侧徽章也看不到（实测页面宽 1359px > 视口 1280px）。
 *
 * 根因：面板 #viewOrdersPanel 的骨架类名是 ``col-lg-10 offset-lg-1``，
 * Bootstrap 的 offset 是 ``margin-left: 8.333%``；而工作区（web-workspace-shell
 * / mobile-workspace-view-orders / desktop-mode）把面板强制成整行
 * （``flex: 0 0 100%; max-width: 100%``）。**100% 宽 + 8.33% 左边距 = 溢出
 * 整行约 8%**，多出来的那一截正好在右边，于是被外层裁掉。
 *
 * 修法：面板既然永远是整行（它只在 ``mobile-workspace-view-orders`` 下显示，
 * 而那条规则就是整行），offset 的左边距就永远是多余的 —— 清零即可。
 * 用 id 选择器压过 Bootstrap 的 ``.offset-lg-1``（0,1,0 < 1,0,0），
 * 不依赖样式表的先后顺序。
 */
#viewOrdersPanel {
  margin-left: 0;
}
