:root {
  --accent: #f0a040;
  --accent-mat: #50c878;
  --bg-base: #0a0a0c;
  --bg-card: #1a1a1f;
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f0f2;
  --text-secondary: #9a9aa8;
  --text-muted: #6b6b78;
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-accent: 0 8px 32px rgba(240, 160, 64, 0.15);
  --shadow-mat: 0 8px 32px rgba(80, 200, 120, 0.12);
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-fast: 0.25s;
}

/* Sub-page shell */
.list-page {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.list-page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px clamp(12px, 4vw, 24px);
  padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.list-page-header .back-btn {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.list-page-header h1 {
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.list-page-header .count {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.list-page-body {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 36px) clamp(12px, 4vw, 24px) 48px;
}

.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 20px;
  font-size: 0.95rem;
}

/* Filter */
.mat-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.mat-filter-btn {
  padding: 8px 18px;
  min-height: 40px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}

.mat-filter-btn:hover {
  border-color: rgba(80, 160, 80, 0.4);
  color: #6bc96b;
}

.mat-filter-btn.active {
  background: rgba(80, 160, 80, 0.1);
  border-color: rgba(80, 200, 120, 0.35);
  color: var(--accent-mat);
}

.mat-filter-btn .mat-count {
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.65;
}

/* Material cards */
.mat-grid,
.mold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.mat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mat-card-img {
  height: 148px;
  background: #16161c;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mat-card-img .mat-card-placeholder {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.mat-card-body {
  padding: 20px 22px 24px;
  flex: 1;
}

.mat-card-title {
  color: var(--accent-mat);
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.35;
}

.mat-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.mat-card-list li {
  padding: 5px 0 5px 16px;
  position: relative;
  line-height: 1.55;
  word-break: break-word;
}

.mat-card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-mat);
  opacity: 0.65;
}

.mat-card-list strong {
  color: var(--text-primary);
  font-weight: 500;
}

.mat-card-list .blank {
  color: var(--text-muted);
  font-style: italic;
}

/* Mold cards */
.mold-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  padding-bottom: 32px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.mold-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.mold-card h4 {
  color: var(--accent);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.mold-card .badge {
  padding: 4px 10px;
  background: rgba(240, 160, 64, 0.12);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.mold-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.mold-card ul li {
  padding: 5px 0 5px 16px;
  position: relative;
  line-height: 1.55;
  word-break: break-word;
}

.mold-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.mold-card ul li strong {
  color: var(--text-primary);
  font-weight: 500;
}

.mold-card .mold-img-wrap {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #111;
}

.mold-card .mold-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .mat-card,
  .mold-card {
    transition: transform var(--dur-fast) var(--ease-out),
      border-color var(--dur-fast),
      box-shadow var(--dur-fast);
  }

  .mat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(80, 200, 120, 0.3);
    box-shadow: var(--shadow-md), var(--shadow-mat);
  }

  .mold-card:hover {
    transform: translateY(-4px);
    border-color: rgba(240, 160, 64, 0.25);
    box-shadow: var(--shadow-md), var(--shadow-accent);
  }

  .mold-card:hover .mold-img-wrap img {
    transform: scale(1.05);
  }

  .mold-card .mold-img-wrap img {
    transition: transform var(--dur-fast) var(--ease-out);
  }
}

/* 手机端与 PC 相同网格布局，仅优化筛选条横向滑动 */
@media (max-width: 768px) {
  .mat-filter {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -4px 20px;
    padding: 0 4px 4px;
  }

  .mat-filter::-webkit-scrollbar {
    display: none;
  }

  .mat-filter-btn {
    flex-shrink: 0;
  }
}
