* {
  box-sizing: border-box;
}

:root {
  --orange: #2fa866;
  --line: rgba(91, 155, 123, 0.44);
  --bg: #07130f;
  --card-bg: rgba(13, 31, 24, 0.92);
  --panel-bg: rgba(15, 56, 39, 0.92);
  --text: #effaf4;
  --muted: #b8d0c3;
  --accent: #2fa866;
  --accent-dark: #1f7a4b;
  --accent-soft: #dff7ea;
  --surface: rgba(14, 32, 25, 0.86);
  --surface-strong: rgba(18, 48, 35, 0.96);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(160deg, #06110d 0%, #0a1a14 42%, #101814 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
}

.page {
  width: min(1920px, 100%);
  margin: 0 auto;
  padding: 18px;
}

/* 顶部说明区 */
.page-header {
  margin: 0 auto 18px;
  padding: 18px 22px;
  background:
    linear-gradient(135deg, rgba(13, 46, 33, 0.98), rgba(31, 122, 75, 0.86));
  border: 1px solid rgba(155, 216, 181, 0.38);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #eafff2;
  font-weight: 800;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-header h1 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.1;
}

.page-header p {
  margin: 0;
  color: rgba(239, 250, 244, 0.82);
  font-size: 16px;
  line-height: 1.7;
}

/* 搜索和筛选区 */
.filter-section {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(150px, 0.5fr));
  gap: 12px;
  align-items: center;
}

.search-input,
.filter-select {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  border: 1px solid rgba(115, 184, 146, 0.42);
  border-radius: 999px;
  background: rgba(13, 31, 24, 0.92);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  outline: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-input::placeholder {
  color: #88aa98;
  font-weight: 500;
}

.search-input:focus,
.filter-select:focus {
  background: rgba(12, 40, 28, 0.96);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 168, 102, 0.18), 0 14px 30px rgba(0, 0, 0, 0.24);
}

/* 卡片外部网格：电脑一排 5 个 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

/* 单张卡片 */
.drink-card {
  width: 100%;
  height: 255px;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid rgba(116, 198, 157, 0.34);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  padding: 8px;
  display: grid;
  grid-template-columns: 30% 1fr;
  column-gap: 10px;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.drink-card:hover {
  transform: translateY(-2px);
  border-color: rgba(116, 198, 157, 0.68);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

/* 左侧图片区域 */
.image-area {
  width: 100%;
  height: 100%;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23, 58, 43, 0.96), rgba(8, 20, 16, 0.96));
}

.slider-track {
  width: 200%;
  height: 100%;
  display: flex;
  animation: autoSlide 24s infinite;
}

.slide {
  width: 50%;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.slide-green {
  background: linear-gradient(145deg, #2fa866, #74c69d);
  border-radius: 12px;
}

@keyframes autoSlide {
  0%,
  42% {
    transform: translateX(0);
  }

  50%,
  92% {
    transform: translateX(-50%);
  }

  100% {
    transform: translateX(0);
  }
}

.bottle-svg,
.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18));
}

/* 右侧内容：核心优化点 */
.info {
  min-width: 0;
  height: 100%;
  padding: 6px 2px;
  text-align: center;
  display: grid;
  grid-template-rows: minmax(42px, auto) 28px auto;
  align-content: center;
  row-gap: 7px;
  align-items: center;
}

/* 标题 */
.title {
  margin: 0;
  color: var(--text);
  font-size: clamp(16px, 0.95vw, 22px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 规格 */
.spec {
  width: 100%;
  max-width: 210px;
  min-height: 26px;
  margin: 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(35, 78, 57, 0.92), rgba(18, 45, 33, 0.94));
  color: var(--muted);
  font-size: clamp(10px, 0.68vw, 13px);
  font-weight: 800;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(116, 198, 157, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* 糖分面板 */
.sugar-panel {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  padding: 7px 8px 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(27, 90, 61, 0.9), rgba(12, 48, 33, 0.96));
  border: 1px solid rgba(116, 198, 157, 0.34);
  box-shadow: 0 8px 18px rgba(47, 168, 102, 0.1);
  overflow: hidden;
}

.sugar-meta {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: clamp(10px, 0.68vw, 13px);
  font-weight: 800;
  line-height: 1.18;
}

.sugar-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  color: var(--text);
  font-weight: 800;
  flex-wrap: nowrap;
  line-height: 1;
}

.sugar-row .approx,
.sugar-row .unit {
  font-size: clamp(9px, 0.65vw, 13px);
  white-space: nowrap;
}

.sugar-row .number {
  color: var(--orange);
  font-size: clamp(30px, 1.9vw, 42px);
  line-height: 0.9;
  font-weight: 950;
  text-shadow: 0 4px 10px rgba(47, 168, 102, 0.28);
  white-space: nowrap;
}

.calorie {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-size: clamp(9px, 0.62vw, 12px);
  font-weight: 700;
  line-height: 1.2;
}

/* 说明区 */
.tips {
  margin-top: 24px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid rgba(116, 198, 157, 0.34);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.tips h2 {
  margin: 0 0 8px;
}

.tips p {
  margin: 0 0 12px;
  line-height: 1.7;
  color: var(--muted);
}

.tips code {
  display: inline-block;
  max-width: 100%;
  background: rgba(223, 247, 234, 0.1);
  border-radius: 6px;
  padding: 2px 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tips pre {
  margin: 0;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: #08110d;
  color: #d1fae5;
  line-height: 1.65;
  border: 1px solid rgba(116, 198, 157, 0.2);
}

/* 中等屏幕：一排 3 个 */
@media (max-width: 1280px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .drink-card {
    height: 275px;
  }
}

/* 筛选区平板适配 */
@media (max-width: 900px) {
  .filter-section {
    grid-template-columns: 1fr 1fr;
  }

  .search-input {
    grid-column: 1 / -1;
  }
}

/* 手机：一排 2 个 */
@media (max-width: 700px) {
  .page {
    padding: 10px;
  }

  .page-header {
    padding: 16px;
    border-radius: 18px;
  }

  .filter-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-input,
  .filter-select {
    height: 44px;
    font-size: 15px;
    padding: 0 14px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .drink-card {
    height: 230px;
    grid-template-columns: 1fr;
    grid-template-rows: 33% 1fr;
    row-gap: 4px;
    padding: 6px;
    border-radius: 13px;
  }

  .image-area {
    border-radius: 10px;
  }

  .info {
    padding: 0;
    grid-template-rows: minmax(30px, auto) 22px auto;
    row-gap: 3px;
  }

  .title {
    font-size: clamp(11px, 3.2vw, 15px);
    line-height: 1.1;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .spec {
    min-height: 20px;
    padding: 2px 5px;
    font-size: clamp(8px, 2.3vw, 10px);
  }

  .sugar-panel {
    padding: 4px 5px;
    border-radius: 9px;
  }

  .sugar-meta {
    font-size: clamp(8px, 2.3vw, 10px);
    margin-bottom: 1px;
  }

  .sugar-row {
    gap: 3px;
  }

  .sugar-row .approx,
  .sugar-row .unit {
    font-size: clamp(8px, 2.2vw, 10px);
  }

  .sugar-row .number {
    font-size: clamp(20px, 6vw, 28px);
  }

  .calorie {
    font-size: clamp(8px, 2.2vw, 10px);
    margin-top: 3px;
    padding-top: 3px;
  }

  .tips {
    padding: 16px;
    border-radius: 18px;
  }
}

/* 极窄手机 */
@media (max-width: 420px) {
  .drink-card {
    height: 215px;
    grid-template-rows: 31% 1fr;
  }

  .title {
    font-size: 11px;
  }

  .sugar-row .number {
    font-size: 22px;
  }
}



/* ===== 更大版：规格、含糖、热量文字 ===== */

.spec {
  font-size: clamp(14px, 0.95vw, 18px);
  font-weight: 950;
}

.sugar-meta {
  font-size: clamp(14px, 0.95vw, 18px);
  font-weight: 950;
}

.calorie {
  font-size: clamp(13px, 0.85vw, 16px);
  font-weight: 950;
}

@media (max-width: 700px) {
  .spec {
    font-size: clamp(11px, 3vw, 13px);
  }

  .sugar-meta {
    font-size: clamp(11px, 3vw, 13px);
  }

  .calorie {
    font-size: clamp(10px, 2.8vw, 12px);
  }
}




/* ===== 方糖数字按糖分等级变色 ===== */

.sugar-number.zero {
  color: #22c55e;
  text-shadow: 0 4px 10px rgba(34, 197, 94, 0.28);
}

.sugar-number.low {
  color: #2dd4bf;
  text-shadow: 0 4px 10px rgba(45, 212, 191, 0.28);
}

.sugar-number.middle {
  color: #fbbf24;
  text-shadow: 0 4px 10px rgba(251, 191, 36, 0.28);
}

.sugar-number.high {
  color: #f87171;
  text-shadow: 0 4px 10px rgba(248, 113, 113, 0.28);
}



.data-error {
  grid-column: 1 / -1;
  padding: 18px 20px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
  text-align: center;
}





/* ===== 手机端保持和电脑端一样的卡片内部布局 ===== */

/* 电脑和手机统一：左图右文 */
.drink-card {
  display: grid;
  grid-template-columns: 30% 1fr;
}

/* 手机端：只缩放尺寸，不改变内部结构 */
@media (max-width: 700px) {
  .page {
    padding: 10px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .drink-card {
    height: 230px;
    grid-template-columns: 30% 1fr;
    grid-template-rows: none;
    column-gap: 6px;
    row-gap: 0;
    padding: 6px;
    border-radius: 13px;
  }

  .image-area {
    width: 100%;
    height: 100%;
    align-self: stretch;
    border-radius: 10px;
  }

  .info {
    height: 100%;
    padding: 0;
    display: grid;
    grid-template-rows: minmax(34px, auto) 22px auto;
    align-content: center;
    align-items: center;
    row-gap: 4px;
  }

  .title {
    font-size: clamp(11px, 3vw, 15px);
    line-height: 1.1;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .spec {
    min-height: 20px;
    padding: 2px 5px;
    font-size: clamp(8px, 2.2vw, 10px);
  }

  .sugar-panel {
    padding: 4px 5px;
    border-radius: 9px;
  }

  .sugar-meta {
    font-size: clamp(8px, 2.2vw, 10px);
    margin-bottom: 1px;
  }

  .sugar-row {
    gap: 2px;
  }

  .sugar-row .approx,
  .sugar-row .unit {
    font-size: clamp(7px, 2vw, 9px);
  }

  .sugar-row .number {
    font-size: clamp(20px, 5.8vw, 27px);
  }

  .calorie {
    font-size: clamp(7px, 2vw, 9px);
    margin-top: 3px;
    padding-top: 3px;
  }
}

/* 极窄手机也保持左图右文 */
@media (max-width: 420px) {
  .drink-card {
    height: 220px;
    grid-template-columns: 30% 1fr;
    grid-template-rows: none;
  }

  .title {
    font-size: 11px;
  }

  .sugar-row .number {
    font-size: 22px;
  }
}



.load-more-btn {
  display: block;
  margin: 22px auto 0;
  width: min(320px, 100%);
  height: 48px;
  border: 1px solid rgba(116, 198, 157, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(29, 85, 58, 0.94), rgba(14, 56, 38, 0.96));
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.load-more-btn:hover {
  border-color: var(--orange);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(47, 168, 102, 0.16);
}

.load-more-btn.is-hidden {
  display: none;
}




.share-section {
  margin: 40px auto 20px;
  text-align: center;
}

.share-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, #2fa866, #1f7a4b);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(47, 168, 102, 0.26);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(47, 168, 102, 0.34);
}

.share-btn:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.share-tip {
  margin-top: 12px;
  min-height: 22px;
  font-size: 14px;
  color: #86efac;
  font-weight: 700;
}

.manual-share-box {
  display: block;
  width: min(560px, 100%);
  min-height: 118px;
  margin: 12px auto 0;
  padding: 12px 14px;
  border: 1px solid rgba(116, 198, 157, 0.42);
  border-radius: 16px;
  background: rgba(8, 17, 13, 0.92);
  color: #effaf4;
  font: 700 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  resize: vertical;
  outline: none;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.manual-share-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 168, 102, 0.16), 0 12px 26px rgba(0, 0, 0, 0.22);
}

.manual-share-box[hidden] {
  display: none;
}
