* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
}
html { font-size: 16px; overflow-x: hidden; }
body {
  font-family: inherit;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 40%, #16213e 100%);
  min-height: 100vh;
  color: #e4e4e7;
  padding: 16px;
  overflow-x: hidden;
}
a { color: #a78bfa; text-decoration: none; transition: color 0.25s ease; -webkit-tap-highlight-color: transparent; }
a:hover { color: #c4b5fd; }
button { -webkit-tap-highlight-color: transparent; }

/* 中央面板 - PC端更大，高度适配浏览器 */
.panel {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: rgba(26, 26, 46, 0.95);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* 顶部 Header - 全宽，紫蓝渐变 */
.header {
  flex-shrink: 0;
  background: linear-gradient(90deg, #4c1d95 0%, #5b21b6 50%, #6d28d9 100%);
  padding: 18px 28px;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}
.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
}
.header-spacer { flex: 1; }
.header-inner h1 {
  font-size: 24px;
  font-weight: 600;
  flex: 0 0 auto;
  text-align: center;
}
.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
.btn-order {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 8px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.25s ease;
}
.btn-order:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* 主内容区 - 填充剩余高度 */
.main {
  display: flex;
  flex: 1;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

/* 左侧分类 - 矩形设计 PC端更大 */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 24px;
  border-right: 1px solid rgba(100, 116, 139, 0.2);
}
.sidebar-box {
  background: rgba(30, 41, 59, 0.9);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sidebar-box h3 {
  font-size: 16px;
  color: #94a3b8;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}
.cat-item {
  display: block;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 6px;
  font-size: 15px;
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease, transform 0.25s ease;
}
.cat-item:hover {
  background: rgba(124, 58, 237, 0.25);
  color: #fff;
  transform: translateX(4px);
}
.cat-item.active {
  background: linear-gradient(90deg, #6d28d9, #7c3aed);
  color: #fff;
}

/* 商品列表 */
.products {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px;
  background: rgba(22, 22, 40, 0.6);
  overflow-y: auto;
  min-height: 0;
}
.product-card {
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  transition: border-color 0.35s ease, box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
}
.product-info { flex: 1; min-width: 0; overflow: hidden; }
.product-info h4 { font-size: 19px; margin-bottom: 8px; font-weight: 600; word-break: break-word; }
.product-info p {
  font-size: 15px;
  color: #94a3b8;
  line-height: 1.55;
  word-break: break-word;
}
.product-price {
  font-size: 22px;
  font-weight: 600;
  color: #22c55e;
  margin-right: 24px;
  flex-shrink: 0;
}
.btn-buy {
  background: linear-gradient(90deg, #6d28d9, #7c3aed);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}
.btn-buy:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 16px;
}

/* 订单查询页 */
.order-page {
  background: transparent;
}
.order-page h2 { margin-bottom: 24px; text-align: center; font-weight: 600; }
.order-form { margin-bottom: 20px; }
.order-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #e4e4e7;
  font-size: 16px;
  transition: border-color 0.25s ease;
}
.order-form input:focus {
  outline: none;
  border-color: #7c3aed;
}
.order-form button {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(90deg, #6d28d9, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: opacity 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
}
.order-form button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.order-result {
  margin-top: 20px;
  padding: 20px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  display: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.order-result.show { display: block; }
.order-result.success .cdkey { color: #22c55e; font-weight: 600; margin-top: 8px; }

/* 订单页 - 使用 panel 包裹 */
.panel-order {
  min-height: auto;
}
.panel-order .order-page {
  padding: 32px 40px;
  max-width: 520px;
  margin: 0 auto;
}

/* 购买确认弹窗 */
.buy-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.buy-modal.show { display: flex; }
.buy-modal-content {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  border: 1px solid #334155;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.buy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #334155;
}
.buy-modal-header h3 { font-size: 18px; }
.buy-modal-close {
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
  transition: color 0.25s ease, transform 0.2s ease;
}
.buy-modal-close:hover { color: #fff; transform: scale(1.1); }
.buy-modal-body { padding: 20px; }
.buy-modal-product {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.buy-modal-title { color: #f97316; font-size: 16px; margin-bottom: 8px; }
.buy-modal-desc { color: #94a3b8; font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.buy-modal-price { color: #22c55e; font-size: 18px; font-weight: 600; }
.buy-modal-tip,
.buy-modal-note {
  color: #64748b;
  font-size: 13px;
  margin-top: 12px;
  padding: 8px 0;
  border-top: 1px dashed #334155;
}
.buy-modal-contact { margin-bottom: 12px; }
.buy-modal-contact label {
  display: block;
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.buy-modal-contact input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #475569;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #e4e4e7;
  font-size: 15px;
}
.buy-modal-contact input:focus {
  outline: none;
  border-color: #7c3aed;
}
.buy-modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(90deg, #6d28d9, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 0 0 12px 12px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
}
.buy-modal-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

/* ========== 响应式 - 平板 ========== */
@media (max-width: 768px) {
  body { padding: 12px; }
  .panel { border-radius: 12px; min-height: auto; }
  .header { padding: 12px 16px; }
  .header-inner h1 { font-size: 18px; }
  .btn-order { padding: 6px 16px; font-size: 13px; }
  .main { flex-direction: column; min-height: auto; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    padding: 12px;
  }
  .sidebar-box { padding: 12px; }
  .sidebar-box h3 { margin-bottom: 10px; }
  .cat-item {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
  }
  .products { padding: 16px; gap: 12px; }
  .product-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }
  .product-info h4 { font-size: 16px; }
  .product-info p { font-size: 13px; }
  .product-price { margin-right: 0; font-size: 18px; }
  .product-card .product-price,
  .product-card .btn-buy {
    align-self: flex-end;
  }
  .product-card .btn-buy { width: auto; min-width: 100px; }
  .panel-order .order-page { padding: 24px 16px; }
}

/* ========== 响应式 - 手机 ========== */
@media (max-width: 480px) {
  body { padding: 8px; }
  .panel { border-radius: 10px; min-height: auto; }
  .header { padding: 10px 12px; }
  .header-inner {
    position: relative;
    justify-content: flex-end;
  }
  .header-spacer { display: none; }
  .header-inner h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    white-space: nowrap;
  }
  .header-right { flex: 0 0 auto; }
  .btn-order { padding: 6px 14px; font-size: 12px; }
  .sidebar { padding: 10px; }
  .sidebar-box { padding: 10px; }
  .sidebar-box h3 { font-size: 13px; }
  .cat-item { padding: 8px 12px; font-size: 13px; }
  .products { padding: 12px; gap: 10px; }
  .product-card { padding: 14px; }
  .product-info h4 { font-size: 15px; }
  .product-info p { font-size: 12px; }
  .product-price { font-size: 17px; }
  .btn-buy { padding: 10px 16px; font-size: 14px; }
  .buy-modal { padding: 12px; }
  .buy-modal-content { max-width: 100%; border-radius: 10px; }
  .buy-modal-header { padding: 12px 16px; }
  .buy-modal-body { padding: 16px; }
  .buy-modal-btn { padding: 12px; font-size: 15px; }
  .order-page h2 { font-size: 18px; }
  .order-form input, .order-form button { padding: 12px 14px; font-size: 15px; }
  .panel-order .order-page { padding: 20px 12px; }
}
