:root {
  --bg: #e9f5ff;
  --panel: rgba(255, 255, 255, 0.88);
  --text: #172033;
  --muted: #65738a;
  --line: #d5e6f7;
  --blue: #0877e8;
  --cyan: #12aeb6;
  --green: #008b6b;
  --red: #d71920;
  --shadow: 0 16px 40px rgba(25, 93, 154, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(120deg, #f8fbff 0%, var(--bg) 48%, #8ac7ff 100%);
}

button, input, select { font: inherit; }

.page {
  width: min(980px, calc(100% - 24px));
  margin: 18px auto 36px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: rgba(238, 247, 255, 0.9);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #ffd847;
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
}

p { margin: 0; color: var(--muted); }

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
}

.rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.rules div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(25, 93, 154, 0.08);
}

.rules strong { font-size: 18px; }
.rules span { color: var(--red); font-weight: 700; }

.toolbar {
  display: grid;
  grid-template-columns: 1fr 132px 132px;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  gap: 18px;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 10px;
  align-self: start;
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding-right: 4px;
}

.tab {
  display: -webkit-box;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #34445a;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  padding: 9px 10px;
  overflow: hidden;
  text-align: center;
  word-break: break-all;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tab.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
}

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}

.secondary-button {
  height: 36px;
  border: 1px solid #b8daf8;
  border-radius: 8px;
  padding: 0 14px;
  background: #eef8ff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}

.product-list {
  display: grid;
  gap: 18px;
}

.card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(25, 93, 154, 0.12);
}

.thumb {
  width: 128px;
  height: 128px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f4f8;
}

.card-body {
  min-width: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: #dff1ff;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
}

.title {
  margin: 8px 0;
  font-size: 18px;
  line-height: 1.35;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pill {
  border: 1px solid #98e4d8;
  border-radius: 8px;
  padding: 5px 10px;
  background: #ecfffb;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.sku-pill {
  border-color: #bddcf8;
  background: #eff8ff;
  color: #1769b5;
}

.benefit {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  color: #3d4b62;
  background: rgba(255, 255, 255, 0.64);
}

.benefit strong { color: var(--red); }

.actions {
  margin-top: 12px;
}

.jd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #0067d6);
  color: white;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.jd-button.disabled {
  background: #b8c7d9;
  color: white;
  cursor: not-allowed;
}

.empty {
  padding: 36px 18px;
  border-radius: 8px;
  background: rgba(255,255,255,0.7);
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(17, 32, 52, 0.92);
  color: white;
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 680px) {
  .page {
    width: min(430px, calc(100% - 16px));
    margin-top: 8px;
  }

  .hero { padding: 14px; }
  h1 { font-size: 20px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input { grid-column: 1 / -1; }
  .layout { display: block; }
  .tabs {
    position: static;
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    padding: 0 0 8px;
    margin-bottom: 10px;
  }
  .tab {
    flex: 0 0 auto;
    width: 104px;
    min-height: 48px;
    font-size: 13px;
  }
  .card { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .thumb { width: 96px; height: 96px; }
  .title { font-size: 15px; }
  .jd-button { width: 100%; }
}
