/* ── 市场页 ── */
.d2-market-header {
  margin-bottom: 1.5rem;
}

/* 过滤栏 */
.d2-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.d2-filter-bar .d2-input {
  flex: 1;
  min-width: 140px;
  max-width: 260px;
}
.d2-filter-bar select.d2-input {
  flex: 0 0 auto;
  width: auto;
  min-width: 110px;
  cursor: pointer;
}

.d2-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.d2-item-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.d2-item-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 我的发布 */
.d2-mylistings-form {
  margin-bottom: 2rem;
}

/* 交易记录 */
.d2-tx-type {
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* ── 商品图片 ── */
.d2-item-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border: 1px solid var(--d2-stone-border);
  border-radius: 2px;
  margin-bottom: 0.6rem;
  cursor: zoom-in;
  background: rgba(0, 0, 0, 0.4);
}
.d2-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.d2-item-image:hover img {
  transform: scale(1.05);
}

/* 发布页图片预览 */
.d2-image-preview {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.d2-image-preview img {
  max-width: 200px;
  max-height: 200px;
  border: 2px solid var(--d2-gold-dim);
  border-radius: 3px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.4);
}

/* ── 装备名称输入行 ── */
.d2-name-row {
  display: flex;
  gap: 0.5rem;
}
.d2-name-row .d2-input {
  flex: 1;
}
.d2-name-row .d2-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
/* 无形物品复选框 */
.d2-ethereal-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--d2-text);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem 0;
}
.d2-ethereal-label input[type="checkbox"] {
  accent-color: var(--d2-gold);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
/* ── 装备选择模态框 ── */
.d2-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.d2-modal-box {
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  background: linear-gradient(180deg, var(--d2-stone) 0%, var(--d2-surface) 100%);
  border: 2px solid var(--d2-gold-dim);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), var(--shadow-gold);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.d2-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--d2-stone-border);
}
.d2-modal-close {
  background: none;
  border: none;
  color: var(--d2-text);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.5rem;
}
.d2-modal-close:hover { color: var(--d2-gold); }
.d2-modal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--d2-stone-border);
}
.d2-modal-filters .d2-input { flex: 1; min-width: 120px; }
.d2-modal-filters select.d2-input { cursor: pointer; }
.d2-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-y: auto;
}

/* 装备项 */
.d2-eq-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--d2-stone-border);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.d2-eq-item:hover {
  border-color: var(--d2-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}
.d2-eq-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}
.d2-eq-name {
  font-size: 0.8rem;
  color: var(--d2-text);
  line-height: 1.2;
}
.d2-eq-meta {
  font-size: 0.7rem;
  color: var(--d2-text-dim);
}

/* ── 市场表格 ── */
.d2-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--d2-stone-border);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.25);
}
.d2-market-table th { white-space: nowrap; }
.d2-market-row { cursor: pointer; }
.d2-market-row:hover td { background: rgba(199, 165, 82, 0.08); }
.d2-cell-img {
  width: 64px;
  text-align: center;
}
.d2-cell-img img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
  border: 1px solid var(--d2-stone-border);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.5);
}
.d2-cell-name { color: var(--d2-white); font-weight: 500; }
.d2-cell-qty { text-align: center; color: var(--d2-blue); font-weight: bold; }
.d2-qq {
  color: var(--d2-text-dim);
  font-size: 0.75rem;
}

/* ── 装备详情弹窗 ── */
#detail-body {
  padding: 1rem;
  overflow-y: auto;
}
.d2-detail-image {
  text-align: center;
  margin-bottom: 0.75rem;
  cursor: zoom-in;
}
.d2-detail-image img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  border: 1px solid var(--d2-stone-border);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.5);
}
.d2-detail-name {
  color: var(--d2-gold);
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 8px rgba(199, 165, 82, 0.4);
}
.d2-detail-meta {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--d2-stone-border);
  font-size: 0.9rem;
  line-height: 1.8;
}
.d2-detail-actions {
  margin-top: 1rem;
  text-align: center;
}
.d2-detail-actions .d2-btn { min-width: 160px; }

/* ── 表单并排 ── */
.d2-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.d2-form-row .d2-form-group { flex: 1; }

/* ── 金色按钮 ── */
.d2-btn-gold {
  background: linear-gradient(180deg, #e0b96a 0%, #a87f2f 100%);
  color: #1a1206;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.d2-btn-gold:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-gold);
}
