.craft-topbar {
  position: relative;
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 10px;
  flex-shrink: 0;
}

.craft-anvil {
  height: 72px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(120% 100% at 80% 0%, rgba(124, 92, 255, 0.28), transparent 55%),
    radial-gradient(100% 80% at 10% 100%, rgba(53, 215, 255, 0.16), transparent 50%),
    rgba(255, 255, 255, 0.04);
}

.craft-filter-input {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  padding: 0 12px;
  outline: none;
  box-sizing: border-box;
}

.craft-filter-input:focus {
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.18);
}

.craft-filter-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.craft-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.home-main.home-main-craft {
  overflow: hidden;
}

.craft-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.craft-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.craft-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 18, 32, 0.45);
  cursor: pointer;
  transition: filter var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.craft-card:active {
  filter: brightness(1.12);
  border-color: rgba(124, 92, 255, 0.4);
}

.craft-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.craft-card-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.craft-row-icon,
.craft-row-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 18px;
}

.craft-row-text {
  flex: 1;
  min-width: 0;
}

.craft-row-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.craft-row-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, rgba(255, 255, 255, 0.48));
}

.craft-detail-link {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(221, 214, 254, 0.95);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.craft-detail-link:active {
  filter: brightness(1.15);
}

.craft-rarity-bar {
  width: 4px;
  height: 36px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--rar, var(--primary));
}

.craft-mat-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.craft-mat-thumbs::-webkit-scrollbar {
  display: none;
}

.craft-mat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.craft-mat-thumb {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.craft-mat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.craft-mat-x {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.craft-mat-chip.short .craft-mat-thumb {
  filter: grayscale(0.35);
}

.craft-mat-chip.short .craft-mat-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 113, 113, 0.35);
  border-top: 2px solid #f87171;
}

.craft-mat-chip.short .craft-mat-x {
  color: #f87171;
}

.craft-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease);
}

.craft-btn:active {
  transform: scale(0.97);
}

.craft-btn.mini {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 32px;
}

.craft-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--glow-primary);
}

.craft-btn.warn {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.craft-btn.ghost {
  background: var(--surface-1, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.12));
  color: var(--text, #fff);
}

.craft-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* craft-detail mask/panel/head 骨架见 modal.css；此处仅内容态 */
.craft-detail-mask {
  /* skeleton in modal.css */
}

.craft-detail-panel {
  width: min(100%, var(--app-w));
  max-width: calc(100vw - 32px);
  max-height: min(88dvh, 760px);
  min-height: 0;
  box-sizing: border-box;
  background: var(--panel-grad);
  border: 1px solid rgba(124, 92, 255, 0.22);
  box-shadow: var(--sh-3), 0 0 0 1px rgba(53, 215, 255, 0.06) inset;
}

.craft-detail-head {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.14) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.craft-detail-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.craft-detail-close {
  /* skeleton in modal.css */
}

.craft-detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.craft-detail-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 2px;
}

.craft-detail-result-img,
.craft-detail-result-emoji {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.craft-detail-result-name {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.craft-grade-badge {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--rar) 45%, transparent);
  color: var(--rar);
  background: color-mix(in srgb, var(--rar) 14%, transparent);
}

.craft-detail-result-meta,
.craft-detail-result-remark {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.craft-detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.craft-core-stats {
  padding: 0 !important;
  justify-content: flex-start;
}

.craft-section-head {
  margin-bottom: 2px !important;
  padding-bottom: 6px !important;
}

.craft-more-toggle {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: rgba(53, 215, 255, 0.95);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0;
  cursor: pointer;
}

.craft-item-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.craft-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.craft-stat-row > span:first-child {
  color: rgba(255, 255, 255, 0.55);
}

.craft-stat-row > span:last-child {
  text-align: right;
}

.craft-stat-row .hl {
  color: #fff;
  font-weight: 800;
}

.craft-stat-row-skills .skill-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.craft-detail-section .section-title {
  margin-bottom: 4px;
}

.craft-mat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.craft-mat-row.enough {
  border-color: rgba(74, 222, 128, 0.28);
}

.craft-mat-row.short {
  border-color: rgba(248, 113, 113, 0.35);
}

.craft-mat-check {
  color: #4ade80;
  font-weight: 900;
  width: 16px;
  flex-shrink: 0;
}

.craft-mat-img,
.craft-mat-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 18px;
}

.craft-mat-info {
  flex: 1;
  min-width: 0;
}

.craft-mat-name {
  font-size: 14px;
  font-weight: 700;
}

.craft-mat-qty {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.craft-mat-qty.short {
  color: #fda4a4;
  font-weight: 700;
}

.craft-drop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.craft-drop-main {
  flex: 1;
  min-width: 0;
}

.craft-drop-code {
  font-size: 13px;
  font-weight: 800;
}

.craft-drop-sub {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.48);
}

.craft-detail-foot {
  /* skeleton in modal.css */
}

.craft-run-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--glow-primary);
}

.craft-run-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.craft-burst {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.craft-burst-ring {
  position: absolute;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.75);
  box-shadow: 0 0 24px rgba(53, 215, 255, 0.45);
  animation: craftBurstRing 420ms var(--ease) forwards;
}

.craft-burst-icon {
  font-size: 42px;
  animation: craftBurstIcon 420ms var(--ease) forwards;
  filter: drop-shadow(0 8px 18px rgba(124, 92, 255, 0.55));
}

@keyframes craftBurstRing {
  from {
    transform: scale(0.4);
    opacity: 0.9;
  }
  to {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes craftBurstIcon {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  35% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}
