/* ==========================================================================
   创意工坊 · 页面专属样式
   复用 styles.css 的设计变量（--primary / --accent / --glass / --shadow 等），
   只补充统计页需要的组件，不覆盖官网既有样式。
   ========================================================================== */

.workshop-body {
  --ws-blue: #9badbd;
  --ws-green: #8f9f91;
  --ws-sand: #b9a895;
  --ws-rose: #c49a92;
  --ws-gold: #c9a86a;
  --ws-ink-soft: rgba(32, 36, 43, 0.62);
  --ws-ink-faint: rgba(32, 36, 43, 0.46);
}

.workshop-main {
  padding-top: 132px;
}

/* 隐藏态统一处理（避免被 display:grid 等覆盖） */
.workshop-result[hidden],
.workshop-panel[hidden],
.workshop-alert[hidden],
.workshop-loading[hidden],
.workshop-note[hidden],
.workshop-empty[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   1. 搜索区
   -------------------------------------------------------------------------- */

.workshop-search-section {
  padding-top: 0;
  padding-bottom: 72px;
}

.workshop-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 12px 12px 24px;
  border-radius: 999px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.workshop-search:focus-within {
  border-color: rgba(143, 159, 145, 0.58);
  box-shadow: 0 22px 58px rgba(102, 119, 106, 0.18);
  transform: translateY(-1px);
}

.workshop-search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.workshop-search-icon {
  position: absolute;
  left: 4px;
  color: rgba(99, 115, 100, 0.52);
  pointer-events: none;
}

.workshop-search input {
  width: 100%;
  min-width: 0;
  padding: 16px 8px 16px 38px;
  border: 0;
  outline: none;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  background: transparent;
}

.workshop-search input::placeholder {
  color: rgba(117, 123, 132, 0.78);
  font-weight: 500;
}

.workshop-search .primary-btn {
  min-height: 50px;
  padding: 0 30px;
  cursor: pointer;
  border: 0;
  white-space: nowrap;
}

.workshop-hint {
  max-width: 760px;
  margin: 20px auto 0;
  color: var(--ws-ink-faint);
  font-size: 13.5px;
  line-height: 1.7;
  text-align: center;
}

.workshop-hint code {
  padding: 2px 7px;
  border-radius: 7px;
  color: var(--primary-deep);
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(143, 159, 145, 0.14);
}

.workshop-alert {
  max-width: 760px;
  margin: 22px auto 0;
  padding: 15px 20px;
  border: 1px solid rgba(196, 154, 146, 0.44);
  border-radius: 18px;
  color: #8c4a42;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  background: rgba(196, 154, 146, 0.15);
}

.workshop-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px auto 0;
  color: var(--ws-ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.workshop-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(99, 115, 100, 0.24);
  border-top-color: var(--primary-deep);
  border-radius: 50%;
  animation: wsSpin 0.8s linear infinite;
}

@keyframes wsSpin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   2. 玩家资料卡 + 总览数字
   -------------------------------------------------------------------------- */

.workshop-result .page-section {
  padding-bottom: 72px;
}

.workshop-result:not([hidden]) {
  animation: wsFadeUp 0.55s ease both;
}

@keyframes wsFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.workshop-profile {
  padding: 30px 32px 26px;
  border-radius: var(--radius-md);
}

.workshop-profile-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.workshop-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.workshop-avatar {
  display: block;
  width: 152px;
  height: 152px;
  border: 4px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 22px 52px rgba(54, 62, 75, 0.22);
}

.workshop-avatar-cert {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  color: #4a3810;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: linear-gradient(135deg, #fff1b8 0%, #e8c547 45%, #c9a227 75%, #f5dc7a 100%);
  box-shadow: 0 8px 20px rgba(184, 148, 31, 0.32);
}

.workshop-profile-copy {
  min-width: 0;
}

.workshop-profile-copy .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.workshop-profile-copy h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.workshop-profile-role {
  margin: 0 0 10px;
  color: var(--ws-ink-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.workshop-profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  color: var(--ws-ink-faint);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.workshop-profile-meta #ws-steamid {
  font-variant-numeric: tabular-nums;
}

.workshop-profile-meta a {
  color: var(--primary-deep);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(99, 115, 100, 0.3);
  transition: text-decoration-color 0.25s ease;
}

.workshop-profile-meta a:hover {
  text-decoration-color: var(--primary-deep);
}

.workshop-profile-aside {
  display: grid;
  justify-items: stretch;
  gap: 12px;
  min-width: 220px;
}

.workshop-profile-total {
  padding: 14px 20px;
  border-radius: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.52);
}

.workshop-profile-total strong {
  display: block;
  font-size: 44px;
  letter-spacing: -0.05em;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
}

.workshop-profile-total small {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.workshop-achievements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.workshop-achievements > div {
  padding: 10px 8px;
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

.workshop-achievements dt {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.workshop-achievements dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.workshop-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.workshop-identity-tag {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.5);
  background-clip: padding-box;
}

.workshop-identity-tag.is-cfx {
  border: 1px solid rgba(201, 162, 39, 0.55);
  color: #4a3810;
  background: linear-gradient(135deg, #fff1b8 0%, #e8c547 45%, #c9a227 80%);
  background-clip: padding-box;
  box-shadow: 0 4px 12px rgba(54, 62, 75, 0.1);
}

.workshop-honors {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.workshop-honors-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-bottom: 12px;
}

.workshop-honors-head .eyebrow {
  margin-bottom: 0;
  font-size: 11px;
}

.workshop-honors-count {
  color: var(--ws-ink-faint);
  font-size: 12.5px;
  font-weight: 600;
}

.workshop-honors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workshop-honors-list span {
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 6px 16px rgba(54, 62, 75, 0.06);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.workshop-honors-list span::before {
  content: "✦ ";
  color: var(--primary-deep);
}

.workshop-honors-list span:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.workshop-honors-list span.is-more {
  border-style: dashed;
  color: var(--ws-ink-faint);
  background: transparent;
  box-shadow: none;
}

.workshop-honors-list span.is-more::before {
  content: none;
}

.stat-grid--ws {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 18px;
}

.stat-grid--ws .stat-card {
  padding: 22px 16px 20px;
}

.workshop-stat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 24px rgba(102, 119, 106, 0.22);
}

.workshop-stat-icon.is-blue { background: linear-gradient(135deg, #8aa3b6, #b9a895); }
.workshop-stat-icon.is-sand { background: linear-gradient(135deg, #b9a895, #cfc0aa); }
.workshop-stat-icon.is-green { background: linear-gradient(135deg, #7f9c85, #a9bda0); }
.workshop-stat-icon.is-rose { background: linear-gradient(135deg, #b98b83, #d3b0a8); }
.workshop-stat-icon.is-gold { background: linear-gradient(135deg, #c9a86a, #ddc79c); }

.stat-grid--ws .stat-card strong {
  margin-bottom: 4px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-variant-numeric: tabular-nums;
}

.stat-grid--ws .stat-card small {
  font-size: 12.5px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   3. 工具条（视图切换 / 排序）
   -------------------------------------------------------------------------- */

.workshop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 42px 0 24px;
}

.workshop-tabs {
  margin-bottom: 0;
}

.workshop-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.workshop-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ws-ink-soft);
  font-size: 13.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.55);
}

.workshop-select select {
  padding: 6px 4px;
  border: 0;
  outline: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.workshop-order {
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.workshop-order:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   4. 物品卡片
   -------------------------------------------------------------------------- */

.workshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 20px;
}

.workshop-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-md);
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.22);
  transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.workshop-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.workshop-card-figure {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(99, 115, 100, 0.08);
}

.workshop-card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.workshop-card:hover .workshop-card-figure img {
  transform: scale(1.05);
}

.workshop-card-figure .workshop-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(99, 115, 100, 0.42);
  font-size: 12px;
  font-weight: 700;
}

.workshop-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 20px;
}

.workshop-stars {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--ws-gold);
}

.workshop-stars svg.is-empty {
  color: rgba(99, 115, 100, 0.22);
}

.workshop-stars .workshop-stars-text {
  margin-left: 6px;
  color: var(--ws-ink-faint);
  font-size: 12px;
  font-weight: 600;
}

.workshop-card-title {
  display: -webkit-box;
  min-height: calc(2 * 1.4 * 16px);
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.workshop-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workshop-metrics li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--ws-ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.5);
}

.workshop-metrics svg {
  flex-shrink: 0;
  color: rgba(99, 115, 100, 0.62);
}

.workshop-metrics li.is-views svg { color: #8aa3b6; }
.workshop-metrics li.is-subs svg { color: var(--ws-green); }
.workshop-metrics li.is-favs svg { color: var(--ws-sand); }
.workshop-metrics li.is-likes svg { color: #7f9c85; }
.workshop-metrics li.is-dislikes svg { color: var(--ws-rose); }
.workshop-metrics li.is-awards svg { color: var(--ws-gold); }

.workshop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
  font-size: 12.5px;
}

.workshop-card-date {
  color: var(--ws-ink-faint);
  font-weight: 600;
}

.workshop-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-deep);
  font-weight: 800;
}

.workshop-card-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workshop-empty {
  padding: 46px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--ws-ink-faint);
  font-weight: 600;
  text-align: center;
}

.workshop-note {
  margin: 24px 0 0;
  padding: 14px 18px;
  border: 1px solid rgba(201, 168, 106, 0.42);
  border-radius: 16px;
  color: #7a5c22;
  font-size: 13.5px;
  font-weight: 600;
  background: rgba(201, 168, 106, 0.14);
}

/* --------------------------------------------------------------------------
   5. 图表视图
   -------------------------------------------------------------------------- */

.workshop-chart {
  padding: 26px 28px 18px;
  border-radius: var(--radius-md);
}

.workshop-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 8px;
  color: var(--ws-ink-soft);
  font-size: 12.5px;
  font-weight: 700;
}

.workshop-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.workshop-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.ws-chart-row {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.ws-chart-row:first-of-type {
  border-top: 0;
}

.ws-chart-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.ws-chart-bars {
  display: grid;
  gap: 6px;
}

.ws-chart-bar {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 10px;
  color: var(--ws-ink-faint);
  font-size: 12px;
  font-weight: 600;
}

.ws-chart-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(99, 115, 100, 0.12);
}

.ws-chart-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.6s ease;
}

.ws-chart-value {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* --------------------------------------------------------------------------
   6. 介绍区
   -------------------------------------------------------------------------- */

.workshop-intro {
  padding-top: 0;
  padding-bottom: 96px;
}

.workshop-feature {
  padding: 28px;
  border-radius: var(--radius-md);
}

.workshop-feature-index {
  display: inline-flex;
  margin-bottom: 18px;
  color: rgba(99, 115, 100, 0.5);
  font-weight: 900;
}

.workshop-feature h3 {
  margin: 0 0 10px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.workshop-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.workshop-disclaimer {
  max-width: 880px;
  margin: 40px auto 0;
  color: var(--ws-ink-faint);
  font-size: 12.5px;
  line-height: 1.8;
  text-align: center;
}

/* --------------------------------------------------------------------------
   7. 响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
  .stat-grid--ws {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .workshop-main {
    padding-top: 108px;
  }

  .workshop-profile-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .workshop-profile-aside {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-width: 0;
  }

  .workshop-profile-total strong {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .workshop-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .stat-grid--ws {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workshop-profile {
    padding: 20px;
  }

  .workshop-profile-main {
    gap: 16px;
  }

  .workshop-avatar {
    width: 104px;
    height: 104px;
    border-radius: 22px;
  }

  .workshop-avatar-cert {
    font-size: 10px;
    padding: 4px 10px;
  }

  .workshop-profile-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .workshop-profile-total {
    padding: 12px 16px;
  }

  .workshop-profile-total strong {
    font-size: 30px;
  }

  .workshop-honors-list span {
    font-size: 12px;
    padding: 7px 11px;
  }

  .workshop-chart {
    padding: 20px 18px 12px;
  }

  .ws-chart-bar {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    gap: 8px;
    font-size: 11px;
  }
}

@media (max-width: 620px) {
  .workshop-toolbar {
    align-items: stretch;
  }

  .workshop-tools {
    width: 100%;
  }

  .workshop-select {
    flex: 1;
    justify-content: space-between;
  }

  .workshop-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .workshop-card,
  .workshop-card-figure img,
  .ws-chart-fill,
  .workshop-search,
  .workshop-order {
    transition: none !important;
  }

  .workshop-spinner {
    animation-duration: 2s;
  }

  .workshop-result:not([hidden]) {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   8. 固定账号操作条（本页固定展示难言的作品，替代原来的搜索框）
   -------------------------------------------------------------------------- */

.workshop-actions-section {
  padding-top: 0;
  padding-bottom: 56px;
}

.workshop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 28px;
  border-radius: var(--radius-md);
}

.workshop-actions-copy {
  min-width: 0;
}

.workshop-actions-copy .eyebrow {
  margin-bottom: 8px;
  font-size: 11px;
}

.workshop-actions-name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.workshop-actions-id {
  margin: 0 0 8px;
  color: var(--primary-deep);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.workshop-actions-note {
  max-width: 470px;
  margin: 0;
  color: var(--ws-ink-faint);
  font-size: 13px;
  line-height: 1.65;
}

.workshop-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.workshop-actions-buttons .secondary-btn {
  cursor: pointer;
}

.workshop-actions-buttons .secondary-btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.page-hero p strong {
  color: var(--ink);
  font-weight: 800;
}

#ws-updated {
  color: var(--ws-ink-faint);
  font-size: 12.5px;
}

@media (max-width: 768px) {
  .workshop-actions {
    padding: 20px;
  }

  .workshop-actions-buttons {
    width: 100%;
  }

  .workshop-actions-buttons .primary-btn,
  .workshop-actions-buttons .secondary-btn {
    flex: 1;
  }
}
