/* 电脑配件展示站 —— 首页卡片墙 + 详情弹窗（含手机版） */

:root {
  --g-bg: #0b0b12;
  --g-bg-soft: #12121d;
  --g-card: #161622;
  --g-line: rgba(255, 255, 255, 0.08);
  --g-text: #e9ecf1;
  --g-muted: #8b90a0;
  --g-accent: #7c5cff;
  --g-accent-2: #22d3ee;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

.gallery-body {
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(700px 420px at 92% 4%, rgba(34, 211, 238, 0.12), transparent 60%),
    var(--g-bg);
  color: var(--g-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

.g-wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.g-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 11, 18, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--g-line);
}
.g-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
}
.g-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.g-logo {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; font-size: 20px;
  background: linear-gradient(135deg, var(--g-accent), var(--g-accent-2));
  color: #0b0b12; font-weight: 800;
}
.g-brand h1 { margin: 0; font-size: 19px; letter-spacing: .5px; }
.g-sub { margin: 2px 0 0; font-size: 12px; color: var(--g-muted); }
.g-nav { display: flex; gap: 10px; flex: none; }
.g-btn {
  padding: 9px 14px; border-radius: 10px; font-size: 14px;
  color: var(--g-text); text-decoration: none;
  border: 1px solid var(--g-line); background: rgba(255, 255, 255, 0.04);
}
.g-btn:hover { border-color: rgba(124, 92, 255, .6); }
.g-btn-primary {
  background: linear-gradient(135deg, var(--g-accent), var(--g-accent-2));
  color: #0b0b12; font-weight: 700; border: none;
}

/* 工具条 */
.g-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 22px 0 16px;
}
.g-cats { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.g-cat {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--g-line); background: rgba(255, 255, 255, 0.04);
  color: var(--g-muted); user-select: none;
}
.g-cat:hover { color: var(--g-text); border-color: rgba(124, 92, 255, .5); }
.g-cat.on {
  color: #0b0b12; font-weight: 700; border-color: transparent;
  background: linear-gradient(135deg, var(--g-accent), var(--g-accent-2));
}
.g-cat .n { opacity: .65; margin-left: 4px; font-size: 12px; }
.g-search { flex: 0 0 260px; }
.g-search input {
  width: 100%; padding: 10px 14px; font-size: 14px;
  border-radius: 10px; border: 1px solid var(--g-line);
  background: var(--g-card); color: var(--g-text); outline: none;
}
.g-search input:focus { border-color: rgba(124, 92, 255, .7); }

/* 卡片墙 */
.g-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  padding-bottom: 40px;
}
.g-card {
  background: var(--g-card); border: 1px solid var(--g-line);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.g-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 92, 255, .55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}
.g-card-img {
  position: relative; aspect-ratio: 4 / 3;
  background: #0e0e16; display: grid; place-items: center; overflow: hidden;
}
.g-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.g-card-cat {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px;
  background: rgba(0, 0, 0, .55); color: #cdd3e0;
  border: 1px solid var(--g-line); backdrop-filter: blur(4px);
}
.g-card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.g-card-brand { font-size: 12px; color: var(--g-muted); }
.g-card-name {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.g-card-specs {
  margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--g-muted);
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.g-card-specs li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.g-card-foot {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.g-price { color: #22d3ee; font-weight: 700; font-size: 16px; }
.g-price small { color: var(--g-muted); font-weight: 400; font-size: 12px; margin-right: 2px; }
.g-empty { text-align: center; color: var(--g-muted); padding: 60px 0 80px; }

/* 详情弹窗 */
.g-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.g-modal[hidden] { display: none; }
.g-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); backdrop-filter: blur(3px); }
.g-modal-box {
  position: relative; z-index: 1;
  width: min(760px, 100%); max-height: 88vh; overflow: auto;
  background: var(--g-bg-soft); border: 1px solid var(--g-line);
  border-radius: 16px; display: grid; grid-template-columns: 1fr 1fr;
}
.g-modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: #fff; border: none; font-size: 20px; line-height: 1;
}
.g-modal-close:hover { background: rgba(255, 255, 255, .16); }
.g-modal-img { background: #0c0c13; display: grid; place-items: center; padding: 18px; min-height: 240px; }
.g-modal-img img { max-width: 100%; max-height: 320px; object-fit: contain; }
.g-modal-body { padding: 22px 22px 24px; }
.g-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: rgba(124, 92, 255, .18); color: #b9a8ff; border: 1px solid rgba(124, 92, 255, .35);
}
.g-modal-body h2 { margin: 10px 0 4px; font-size: 20px; }
.g-muted { margin: 0; color: var(--g-muted); font-size: 13px; }
.g-summary { margin: 12px 0 0; font-size: 14px; line-height: 1.6; color: #c9cfdc; }
.g-specs { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 13px; }
.g-specs td { padding: 7px 0; border-bottom: 1px solid var(--g-line); }
.g-specs td:first-child { color: var(--g-muted); width: 42%; }
.g-modal-foot { margin-top: 16px; display: flex; justify-content: flex-end; }
.g-modal-foot .g-price { font-size: 20px; }

/* 页脚 */
.g-footer {
  max-width: 1280px; margin: 0 auto; padding: 18px 20px 32px;
  display: flex; justify-content: space-between;
  color: var(--g-muted); font-size: 12px;
}

/* 手机版 */
@media (max-width: 720px) {
  .g-wrap { padding: 0 12px; }
  .g-header-inner { padding: 12px; gap: 10px; }
  .g-brand h1 { font-size: 16px; }
  .g-sub { display: none; }
  .g-logo { width: 34px; height: 34px; font-size: 17px; }
  .g-btn { padding: 8px 11px; font-size: 13px; }
  .g-toolbar { padding: 14px 0 12px; gap: 10px; }
  .g-cats { gap: 6px; order: 2; width: 100%; }
  .g-cat { padding: 7px 12px; font-size: 13px; }
  .g-search { flex: 1 1 100%; order: 1; }
  .g-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .g-card-body { padding: 9px 10px 11px; gap: 4px; }
  .g-card-name { font-size: 13px; }
  .g-card-specs { display: none; }
  .g-price { font-size: 14px; }
  .g-modal { padding: 0; align-items: flex-end; }
  .g-modal-box { grid-template-columns: 1fr; max-height: 92vh; border-radius: 16px 16px 0 0; width: 100%; }
  .g-modal-img { min-height: 170px; padding: 14px; }
  .g-modal-img img { max-height: 190px; }
  .g-modal-body { padding: 16px 16px 24px; }
  .g-footer { padding: 14px 12px 28px; }
}
