:root {
  --bg: #f4efe8;
  --bg-accent: #e7d7c5;
  --panel: rgba(255, 251, 245, 0.88);
  --border: rgba(82, 58, 38, 0.18);
  --text: #2f241a;
  --muted: #746556;
  --primary: #8c4f2f;
  --primary-strong: #6c3116;
  --success: #2e6e4f;
  --error: #9f2d20;
  --warning: #956013;
  --shadow: 0 18px 45px rgba(80, 51, 24, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-display: "Segoe UI Semibold", "Microsoft YaHei UI", sans-serif;
  --font-body: "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 38%),
    linear-gradient(145deg, var(--bg) 0%, #efe3d4 52%, var(--bg-accent) 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  padding: 12px 0 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.hero-copy {
  max-width: 700px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  backdrop-filter: blur(10px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.controls-panel,
.summary-panel,
.pagination-panel,
.list-panel {
  padding: 22px;
  margin-bottom: 18px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.checkbox-field span,
.summary-label,
.card-label,
.stats-block h4 {
  color: var(--muted);
  font-size: 0.92rem;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(106, 73, 46, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus {
  border-color: rgba(140, 79, 47, 0.62);
  box-shadow: 0 0 0 4px rgba(140, 79, 47, 0.12);
}

button {
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff8f1;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 10px 24px rgba(108, 49, 22, 0.22);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-top: 16px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px)) 140px;
  gap: 14px;
  align-items: end;
  margin-top: 16px;
}

.small-field input {
  padding: 12px 14px;
}

.filter-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.checkbox-field {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.status-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.96rem;
}

.status-banner.idle {
  background: rgba(255, 248, 237, 0.9);
  border-color: rgba(149, 96, 19, 0.16);
}

.status-banner.loading {
  background: rgba(252, 239, 209, 0.96);
  border-color: rgba(149, 96, 19, 0.28);
  color: var(--warning);
}

.status-banner.success {
  background: rgba(229, 245, 236, 0.96);
  border-color: rgba(46, 110, 79, 0.28);
  color: var(--success);
}

.status-banner.error {
  background: rgba(252, 232, 230, 0.96);
  border-color: rgba(159, 45, 32, 0.28);
  color: var(--error);
}

.summary-header,
.list-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.summary-header h2,
.list-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(140, 79, 47, 0.1);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.summary-item {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(82, 58, 38, 0.1);
}

.summary-item strong {
  display: block;
  margin-top: 10px;
  font-size: 1.1rem;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pagination-controls .page-info {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.95rem;
}

.pagination-controls .nav-button {
  min-width: 88px;
}

.list-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.equipment-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.equipment-list.empty {
  min-height: 140px;
  place-items: center;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.equipment-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%),
    linear-gradient(180deg, #1e2128 0%, #151720 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #edf1ff;
  box-shadow: 0 16px 32px rgba(8, 10, 18, 0.3);
}

.equipment-card.has-error {
  border-color: rgba(255, 107, 85, 0.5);
}

.equipment-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -38% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 73, 129, 0.14), transparent 65%);
  pointer-events: none;
}

.equipment-card .card-label {
  color: #8f9ab8;
}

.owner-banner {
  text-align: center;
  color: #f7a531;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 8px;
  word-break: break-word;
}

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

.card-title-wrap {
  flex: 1;
  text-align: center;
}

.star-line {
  min-height: 20px;
  margin-bottom: 4px;
  color: #ffd43b;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.card-title {
  margin: 0;
  color: #ff4d8d;
  font-size: 1.5rem;
  line-height: 1.1;
}

.card-subtitle {
  margin: 8px 0 0;
  color: #f5f2ea;
  font-weight: 700;
  word-break: break-word;
}

.card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.card-status.success {
  background: rgba(90, 215, 142, 0.12);
  color: #78f0b2;
}

.card-status.error {
  background: rgba(255, 107, 85, 0.12);
  color: #ff8e7b;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.meta-chip {
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.meta-chip strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  word-break: break-word;
}

.stats-panel {
  margin-bottom: 18px;
  padding: 14px 14px 12px;
  border-radius: var(--radius-md);
  background: rgba(92, 67, 183, 0.08);
  border: 1px solid rgba(160, 127, 255, 0.12);
}

.stats-panel h4,
.potential-panel h4 {
  margin: 0;
  color: #f1f4ff;
  font-size: 0.96rem;
}

.stat-lines,
.potential-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.stat-lines {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.stat-lines li {
  color: #6fe7ff;
  font-weight: 700;
  line-height: 1.35;
}

.stat-lines .stat-key {
  color: #48f0ff;
}

.stat-lines .stat-detail {
  color: #b8fff0;
  font-weight: 600;
}

.stat-lines .stat-part {
  color: #ffffff;
}

.stat-lines .stat-part-extra {
  color: #7dff8d;
}

.stat-lines .stat-part-enhance {
  color: #48f0ff;
}

.stat-lines .stat-plus {
  color: #b8fff0;
}

.potential-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.potential-panel {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.potential-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #121622;
  background: #cfd3dd;
}

.grade-badge.grade-rare {
  background: #7aa8ff;
}

.grade-badge.grade-epic {
  background: #b988ff;
}

.grade-badge.grade-unique {
  background: #ffd451;
}

.grade-badge.grade-legendary {
  background: #c7ff43;
}

.potential-list {
  display: grid;
  gap: 6px;
}

.potential-list li {
  color: #f4f7ff;
  line-height: 1.35;
}

.potential-list li.grade-rare {
  color: #8ec0ff;
}

.potential-list li.grade-epic {
  color: #d3abff;
}

.potential-list li.grade-unique {
  color: #ffe37c;
}

.potential-list li.grade-legendary {
  color: #d7ff79;
}

.card-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 85, 0.08);
  color: #ff9c8b;
  border: 1px solid rgba(255, 107, 85, 0.18);
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .controls-panel,
  .summary-panel,
  .pagination-panel,
  .list-panel {
    padding: 18px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .pagination-controls .page-info {
    width: 100%;
    margin-left: 0;
  }

  .card-head {
    flex-direction: column;
  }

  .meta-strip {
    grid-template-columns: 1fr;
  }
}
