/* ===== PikVue Shop ===== */
:root {
  --bg: #f8f9fb;
  --bg-soft: #f3f4f6;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #1a1a1a;
  --text-soft: #6b7280;
  --muted: #9ca3af;
  --line: rgba(102, 126, 234, 0.14);
  --primary: #667eea;
  --primary-deep: #5a67d8;
  --primary-soft: rgba(102, 126, 234, 0.08);
  --warm: #f2b94b;
  --shadow: 0 18px 50px rgba(24, 24, 46, 0.08);
  --shadow-soft: 0 10px 30px rgba(102, 126, 234, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
  --transition: all 0.22s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.36), rgba(255,255,255,0.9)),
    radial-gradient(circle at top, rgba(19,150,85,0.08), transparent 36%),
    var(--bg);
}

body.shop-shell {
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(var(--max-width), calc(100% - 24px));
  margin: 0 auto;
}

.shop-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(102, 126, 234, 0.08);
}

.shop-header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
}

.shop-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  min-width: 210px;
}

.shop-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #2ec27e);
  color: white;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px rgba(102, 126, 234, 0.22);
}

.shop-brand-name {
  font-size: 1.08rem;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.shop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.shop-nav-link {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-soft);
  transition: var(--transition);
}

.shop-nav-link:hover,
.shop-nav-link.active {
  color: var(--primary-deep);
  background: rgba(102, 126, 234, 0.08);
}

.shop-header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-search {
  position: relative;
  display: flex;
  align-items: center;
}

.shop-search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}

.shop-search input {
  width: 280px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(102, 126, 234, 0.12);
  background: rgba(255,255,255,0.9);
  padding: 0 16px 0 40px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.shop-search input:focus {
  border-color: rgba(102, 126, 234, 0.35);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.08);
}

.lang-switch {
  border: 1px solid rgba(102, 126, 234, 0.14);
  background: white;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-switch:hover {
  color: var(--primary);
  border-color: rgba(102, 126, 234, 0.3);
}

.ghost {
  background: rgba(255,255,255,0.82);
}

.shop-main {
  width: 100%;
  padding: 24px 0 0;
  flex: 1;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 14px;
}

.panel-header-stack {
  display: block;
}

.panel-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.panel-title {
  font-size: 1.04rem;
  font-weight: 700;
}

.panel-body {
  padding: 0 22px 22px;
}

.announcement-text {
  color: var(--text-soft);
}

.categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip,
.cat-btn {
  border: 1px solid rgba(102, 126, 234, 0.12);
  background: rgba(255,255,255,0.92);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover,
.cat-btn:hover,
.cat-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.18);
}

.products-grid.list-mode {
  display: grid;
  gap: 14px;
}

.product-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 124px;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(102, 126, 234, 0.1);
  cursor: pointer;
  transition: var(--transition);
}

.product-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(102, 126, 234, 0.2);
}

.product-row-cover {
  width: 108px;
  height: 108px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(19,150,85,0.14), rgba(19,150,85,0.04));
}

.product-cover,
.product-row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-cover-placeholder,
.detail-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2rem;
  color: white;
  background: linear-gradient(135deg, #667eea, #a5b4fc);
}

.product-cover-placeholder.video,
.detail-cover-placeholder.video {
  background: linear-gradient(135deg, #0d8f72, #818cf8);
}

.product-cover-placeholder.ebook,
.detail-cover-placeholder.ebook {
  background: linear-gradient(135deg, #5a67d8, #818cf8);
}

.product-cover-placeholder.tool,
.detail-cover-placeholder.tool {
  background: linear-gradient(135deg, #667eea, #c7d2fe);
}

.product-row-main {
  min-width: 0;
}

.product-row-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.tag-success {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
}

.tag-warm {
  background: rgba(242, 185, 75, 0.18);
  color: #8f6200;
}

.product-row-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.product-row-summary {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-row-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.product-row-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.product-row-price,
.product-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.row-action,
.btn,
.btn-primary,
.btn-outline,
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.row-action,
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  padding: 10px 16px;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.16);
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 1px solid rgba(102, 126, 234, 0.16);
  padding: 10px 16px;
}

.btn-accent {
  background: #667eea;
  color: white;
  padding: 10px 16px;
}

.btn-lg {
  min-height: 48px;
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
}

.product-detail {
  max-width: 900px;
  margin: 28px auto 0;
  padding: 0 12px 24px;
}

.product-detail-header {
  text-align: center;
  margin-bottom: 26px;
}

.product-detail-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 24px;
  margin-bottom: 26px;
  border: 1px solid rgba(102, 126, 234, 0.12);
  box-shadow: var(--shadow);
}

.detail-cover-placeholder {
  height: 360px;
  border-radius: 24px;
  margin-bottom: 26px;
  font-size: 4rem;
}

.product-detail h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.product-detail .description,
.product-description-card,
.purchase-box,
.download-card {
  background: var(--card-solid);
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.product-description-card,
.purchase-box,
.download-card {
  padding: 28px;
}

.product-description-content {
  display: grid;
  gap: 16px;
}

.desc-block {
  padding: 18px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(19,150,85,0.05), rgba(19,150,85,0.02));
  border: 1px solid rgba(19,150,85,0.08);
}

.desc-block h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.purchase-box {
  margin-top: 24px;
}

.purchase-box h3 {
  margin-bottom: 18px;
  font-size: 1.1rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(102, 126, 234, 0.12);
  background: var(--bg-soft);
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(102, 126, 234, 0.35);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.08);
}

.download-page {
  max-width: 640px;
  margin: 72px auto;
  padding: 0 16px;
}

.download-card {
  text-align: center;
}

.download-card .icon,
.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

.download-card .delivery-content {
  background: var(--bg-soft);
  border: 1px solid rgba(102, 126, 234, 0.08);
  border-radius: 16px;
  padding: 18px;
  margin: 24px 0;
  word-break: break-all;
}

.download-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.footer {
  margin-top: 32px;
  padding: 28px 0 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.poetry-footer {
  width: min(var(--max-width), calc(100% - 24px));
  margin: 18px auto 16px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(102, 126, 234, 0.12);
  background: linear-gradient(90deg, rgba(255,255,255,0.92), rgba(244,251,247,0.92));
  box-shadow: var(--shadow-soft);
}

.poetry-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 28px;
  text-align: center;
}

.poetry-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
  flex: 0 0 auto;
}

.poetry-content {
  color: #4338ca;
  font-size: 0.86rem;
}

.alert {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.alert-error {
  background: #fff2f0;
  color: #c0392b;
  border: 1px solid #f1b6ac;
}

.alert-success {
  background: #eefbf4;
  color: #5a67d8;
  border: 1px solid #a8dfbf;
}

.alert-info {
  background: #eef7f1;
  color: #1b7c4d;
  border: 1px solid #b7dcc7;
}

.loading,
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 3px solid rgba(102, 126, 234, 0.15);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 22px;
  padding: 28px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

@media (max-width: 980px) {
  .shop-header-inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .shop-nav {
    order: 3;
    width: 100%;
  }

  .shop-header-tools {
    margin-left: auto;
  }

  .shop-search input {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(var(--max-width), calc(100% - 16px));
  }

  .shop-header-inner {
    gap: 12px;
    min-height: auto;
  }

  .shop-brand {
    min-width: auto;
  }

  .shop-header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .shop-search {
    flex: 1;
  }

  .shop-search input {
    width: 100%;
  }

  .panel-header,
  .panel-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .product-row {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
  }

  .product-row-cover {
    width: 84px;
    height: 84px;
    border-radius: 16px;
  }

  .product-row-side {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .product-detail h1 {
    font-size: 1.6rem;
  }

  .detail-cover-placeholder,
  .product-detail-cover {
    max-height: 280px;
    height: 280px;
  }

  .product-description-card,
  .purchase-box,
  .download-card,
  .modal {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .shop-nav {
    gap: 6px;
    overflow-x: auto;
  }

  .shop-nav-link {
    white-space: nowrap;
  }

  .categories {
    gap: 8px;
  }

  .chip,
  .cat-btn {
    padding: 8px 13px;
    font-size: 0.84rem;
  }

  .product-row-title {
    font-size: 1rem;
  }

  .product-row-price,
  .product-price {
    font-size: 1.4rem;
  }

  .poetry-line {
    justify-content: flex-start;
    text-align: left;
  }
}

