/* 基础变量 */
:root {
  --bg: #00081a;
  --panel: rgba(0, 17, 34, 0.9);
  --panel-2: rgba(0, 8, 26, 0.95);
  --primary: #00f0ff;
  --secondary: #0088aa;
  --accent: #ff4d4d;
  --text: #99e6ff;
  --border: rgba(0, 240, 255, 0.28);
  --shadow: 0 0 18px rgba(0, 240, 255, 0.12);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--primary);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

button { font: inherit; }

.container {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top, rgba(0, 240, 255, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(0, 8, 26, 0.88), rgba(0, 0, 20, 0.96));
}

.bg-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../img/bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  filter: brightness(0.8) contrast(1.08);
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 4rem 1rem;
  position: relative;
}

.hero__inner {
  width: min(800px, 100%);
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 17, 34, 0.72), rgba(0, 8, 26, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.hero__eyebrow {
  margin: 0 0 1rem;
  letter-spacing: 3px;
  font-size: 0.9rem;
  color: #7fefff;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.hero p {
  margin: 0 auto 1.8rem;
  max-width: 720px;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero__button,
.btn,
.sort-btn,
.filter-btn,
.cart-toggle {
  border: 1px solid var(--primary);
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  color: #00081a;
  cursor: pointer;
  transition: all 0.25s ease;
}

.hero__button {
  padding: 0.95rem 2.2rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.24);
}

.hero__button:hover,
.btn:hover,
.sort-btn:hover,
.filter-btn:hover,
.cart-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.35);
}

.site-header,
.notice-bar,
.toolbar,
.page-main {
  position: relative;
  z-index: 1;
}

.site-header {
  padding: 1.4rem 0;
  background: linear-gradient(90deg, rgba(0, 8, 26, 0.92), rgba(0, 26, 51, 0.92));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.site-header h2,
.goods-section__head h3 {
  margin: 0;
  color: var(--primary);
}

.site-header p,
.goods-section__head p {
  margin: 0.35rem 0 0;
  color: var(--text);
}

.notice-bar {
  padding: 0.8rem 0;
  background: linear-gradient(90deg, rgba(0, 17, 34, 0.9), rgba(0, 26, 51, 0.9));
  border-bottom: 1px solid var(--border);
}

.notice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  justify-content: center;
  color: var(--text);
  font-weight: 600;
}

.toolbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0;
  flex-wrap: wrap;
}

.toolbar__group {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar__label {
  color: var(--primary);
  font-weight: 700;
}

.filter-buttons,
.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.filter-btn,
.sort-btn {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.filter-btn.active,
.sort-btn.active {
  background: linear-gradient(90deg, var(--primary), #b4ffff);
}

.page-main {
  padding: 1.5rem 0 4rem;
}

.goods-section__head {
  margin-bottom: 1rem;
  padding: 1rem 1rem 0;
}

.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.22);
}

.product-card__image-box {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(0, 8, 26, 0.8);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__body {
  padding: 1rem;
}

.product-card__title {
  margin: 0 0 0.6rem;
  color: var(--primary);
  font-size: 1.05rem;
}

.product-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.product-card__price {
  color: #ffb3b3;
  font-weight: 700;
}

.product-card__tag {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 700;
}

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.floating-cart {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 50;
}

.cart-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
}

.cart-toggle__count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.cart-panel {
  position: absolute;
  top: 50%;
  right: 70px;
  transform: translateY(-50%);
  width: min(420px, calc(100vw - 100px));
  max-height: 80vh;
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(0, 17, 34, 0.96), rgba(0, 8, 26, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cart-panel.show { display: flex; }

.cart-panel__header,
.cart-panel__footer {
  padding: 1rem;
  border-color: rgba(0, 240, 255, 0.18);
}

.cart-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
}

.cart-panel__close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 77, 77, 0.8);
  background: rgba(255, 77, 77, 0.12);
  color: #ff9a9a;
  cursor: pointer;
}

.cart-panel__body {
  padding: 1rem;
  overflow: auto;
  flex: 1;
}

.empty-text {
  color: var(--text);
  text-align: center;
  margin: 1.5rem 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
}

.cart-item:last-child { border-bottom: 0; }

.cart-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item__name {
  color: #dffcff;
  font-weight: 700;
}

.cart-item__sub {
  color: var(--text);
  font-size: 0.92rem;
}

.cart-item__controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cart-item__btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: rgba(0, 136, 170, 0.2);
  color: var(--primary);
  cursor: pointer;
}

.cart-panel__footer {
  border-top: 1px solid rgba(0, 240, 255, 0.18);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.cart-total strong { color: #ffb3b3; }

.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--primary);
  background: rgba(0, 8, 26, 0.95);
  color: var(--primary);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .floating-cart { right: 12px; }
  .cart-panel {
    width: min(360px, calc(100vw - 80px));
    right: 62px;
  }
  .toolbar { gap: 0.8rem; }
  .goods-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .container { width: min(100%, calc(100% - 1rem)); }
  .hero { padding: 2rem 0.8rem; }
  .hero__inner { padding: 2rem 1rem; }
  .goods-grid { grid-template-columns: 1fr; }
  .cart-actions { grid-template-columns: 1fr; }
  .cart-panel {
    width: min(300px, calc(100vw - 72px));
  }
}
