/* 投注单 - V9 orders 风格 */
:root {
  --color-body: #F4F6FA;
  --color-paper: #fff;
  --color-primary: #E60013;
  --color-text: #1F2734;
  --color-text-50: rgba(31, 39, 52, 0.5);
  --color-text-sub: rgba(21, 29, 52, 0.5);
  --app-bar-height: 44px;
  --bottom-nav-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

body.orders-v9 {
  font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-body);
  color: var(--color-text);
  font-size: 14px;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
}

/* 顶栏 */
.orders-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1000;
  height: calc(var(--app-bar-height) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--color-paper);
  display: flex;
  align-items: center;
  justify-content: center;
}

.orders-nav-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  padding: 0 60px;
}

.orders-nav-service {
  position: absolute;
  right: 15px;
  top: var(--safe-top);
  height: var(--app-bar-height);
  display: flex;
  align-items: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-primary);
  font-size: 28px;
  padding: 0;
}

.orders-nav-spacer {
  height: calc(var(--app-bar-height) + var(--safe-top));
}

/* 分类 Tab */
.orders-categories {
  position: sticky;
  top: calc(var(--app-bar-height) + var(--safe-top));
  z-index: 100;
  display: flex;
  overflow-x: auto;
  background: var(--color-paper);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.orders-categories::-webkit-scrollbar { display: none; }

.orders-cat-item {
  position: relative;
  flex-shrink: 0;
  height: 40px;
  padding: 0 22px;
  line-height: 40px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-50);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
}

.orders-cat-item.active {
  color: var(--color-text);
}

.orders-cat-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  border-radius: 3px;
  background: var(--color-primary);
}

/* 状态筛选 */
.orders-filter-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 10px 0;
}

.orders-status-select {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  background: var(--color-paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.orders-status-select i {
  font-size: 20px;
  color: var(--color-text);
}

.orders-status-menu {
  display: none;
  position: absolute;
  left: 10px;
  right: 10px;
  top: 100%;
  margin-top: 4px;
  background: var(--color-paper);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 200;
}

.orders-status-menu.show { display: block; }

.orders-status-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
}

.orders-status-option.active {
  color: var(--color-primary);
  font-weight: 600;
}

.orders-filter-wrap {
  position: relative;
  flex: 1;
}

/* 汇总行 */
.orders-summary {
  display: flex;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 20px;
  font-size: 10px;
  color: var(--color-text-sub);
  scrollbar-width: none;
}

.orders-summary::-webkit-scrollbar { display: none; }

.orders-summary strong {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 600;
  margin-right: 20px;
}

/* 列表区 */
.orders-list {
  padding: 0 10px 10px;
}

.orders-bet-card {
  background: var(--color-paper);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 8px;
}

.orders-bet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.orders-bet-game {
  font-size: 15px;
  font-weight: 600;
}

.orders-bet-status {
  font-size: 12px;
  font-weight: 500;
}

.orders-bet-status.pending { color: #FF8C00; }
.orders-bet-status.won { color: var(--color-primary); }
.orders-bet-status.lost { color: var(--color-text-50); }
.orders-bet-status.cancelled { color: var(--color-text-50); }

.orders-bet-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.8;
}

.orders-bet-label { color: var(--color-text-50); }
.orders-bet-value { color: var(--color-text); }
.orders-bet-value.highlight { color: var(--color-primary); font-weight: 600; }

/* 空状态 */
.orders-empty {
  padding: 45px 20px;
  text-align: center;
}

.orders-empty-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  opacity: 0.35;
  font-size: 56px;
  line-height: 60px;
  color: var(--color-text-50);
}

.orders-empty-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--color-text);
  margin: 10px 0;
}

.orders-empty-desc {
  font-size: 12px;
  color: var(--color-text-50);
  font-weight: normal;
  margin: 0 50px;
  line-height: 1.5;
}

.orders-loading {
  text-align: center;
  padding: 40px;
  color: var(--color-text-50);
  font-size: 13px;
}

/* V9 底部导航 */
.v9-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 1000;
  background: var(--color-paper);
  box-shadow: 0 -1px 8px rgba(0,0,0,0.15);
  padding-bottom: var(--safe-bottom);
}

.v9-tabbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bottom-nav-height);
}

.v9-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-50);
  text-decoration: none;
  font-size: 9px;
  padding: 4px 0;
}

.v9-tab-item.active { color: var(--color-text); }

.v9-tab-item i {
  font-size: 22px;
  margin-bottom: 3px;
}

.v9-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 3px;
}

.v9-tab-icon svg {
  width: 22px;
  height: 21px;
  display: block;
}

.v9-tab-icon--menu-active {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary);
}

.v9-tab-item.orders-active { color: var(--color-text); }

.v9-tab-item.orders-active .orders-tab-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 3px;
}
