/* 水彩手绘风,呼应宫崎骏食物场景的菜品图。 */

@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.6.0/style.css');

:root {
  --paper: #f6ecd8;         /* 旧纸张/奶油米色 */
  --paper-deep: #ead9b4;    /* 稍深的纸色,用于卡片边缘 */
  --ink: #4a3824;           /* 墨褐色,代替纯黑 */
  --ink-soft: #8a7050;      /* 柔和的次级文字 */
  --watercolor-red: #c6603c;/* 水彩橘红,点缀用 */
  --watercolor-green: #7a9456;
  --watercolor-blue: #6a8ca4;
  --shadow: 0 6px 20px rgba(90, 60, 30, 0.12);
  --card-radius: 18px 22px 20px 24px / 22px 18px 24px 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  /* 纸纹:两层径向渐变模拟水彩斑驳 */
  background-image:
    radial-gradient(ellipse at 15% 25%, rgba(201, 162, 102, 0.08) 0, transparent 50%),
    radial-gradient(ellipse at 85% 70%, rgba(201, 112, 70, 0.07) 0, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(122, 148, 86, 0.05) 0, transparent 60%);
  background-attachment: fixed;
  font-family: "LXGW WenKai", "LXGW WenKai Screen", "KaiTi", "STKaiti", "Hiragino Sans GB", serif;
  line-height: 1.6;
  font-size: 16px;
}

/* ===== 顶部 ===== */
.site-header {
  text-align: center;
  padding: 40px 16px 20px;
  position: relative;
}
.site-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 2px;
  color: var(--ink);
  font-weight: 600;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}
.site-header h1::after {
  content: "";
  display: block;
  width: 110px;
  height: 10px;
  margin: 8px auto 0;
  background: radial-gradient(ellipse, var(--watercolor-red) 0%, rgba(198, 96, 60, 0.2) 55%, transparent 75%);
  opacity: 0.75;
}
.subtitle {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-style: italic;
}

/* ===== 容器 ===== */
.container { max-width: 1040px; margin: 0 auto; padding: 20px 20px 60px; }

.empty, .not-found {
  text-align: center;
  padding: 80px 16px;
  color: var(--ink-soft);
  font-size: 17px;
}
.not-found a { color: var(--watercolor-red); }

/* ===== 分类 ===== */
.category { margin-bottom: 40px; }
.category-title {
  font-size: 22px;
  margin: 0 0 16px;
  padding: 4px 14px 4px 18px;
  display: inline-block;
  position: relative;
  color: var(--ink);
  background: linear-gradient(100deg,
    rgba(198, 96, 60, 0.22) 0%,
    rgba(198, 96, 60, 0.15) 60%,
    rgba(198, 96, 60, 0) 100%);
  border-radius: 20px 24px 18px 22px / 18px 22px 20px 24px;
}
.category-title::before {
  content: "✿";
  margin-right: 8px;
  color: var(--watercolor-red);
  font-size: 18px;
}

/* ===== 卡片 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fffaef;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(138, 112, 80, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-2px) rotate(-0.4deg);
  box-shadow: 0 10px 26px rgba(90, 60, 30, 0.18);
}
.card:active { transform: scale(0.98); }
.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--paper-deep);
}
.card-body { padding: 10px 14px 14px; }
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.card-meta {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ===== 详情页 ===== */
.detail {
  background: #fffaef;
  border-radius: var(--card-radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(138, 112, 80, 0.18);
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.back {
  display: inline-block;
  color: var(--watercolor-red);
  text-decoration: none;
  font-size: 15px;
  margin-bottom: 10px;
}
.back:hover { text-decoration: underline wavy; }
.detail-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px 20px 18px 22px / 20px 18px 22px 16px;
  margin: 12px 0 16px;
  background: var(--paper-deep);
  box-shadow: 0 4px 14px rgba(90, 60, 30, 0.14);
}
.detail h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: 1px;
}
.detail-meta {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
}
.detail h2 {
  font-size: 18px;
  margin: 24px 0 8px;
  color: var(--ink);
  padding-left: 10px;
  border-left: 3px solid var(--watercolor-red);
  border-radius: 2px;
}
.detail h3 {
  font-size: 14.5px;
  margin: 12px 0 6px;
  color: var(--ink-soft);
  font-weight: normal;
}
.detail ul, .detail ol { margin: 0; padding-left: 22px; }
.detail li { margin-bottom: 6px; }

/* 食材列表:用图标代替项目符号 */
.detail ul { list-style: none; padding-left: 4px; }
.detail ul li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  margin-bottom: 4px;
  background: rgba(234, 217, 180, 0.3);
  border-radius: 10px 14px 12px 10px / 12px 10px 14px 12px;
  width: fit-content;
  min-width: 140px;
}
.ing-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(90, 60, 30, 0.1));
}
@media (min-width: 480px) {
  .detail ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 10px;
  }
  .detail ul li { width: auto; }
}
.steps li {
  margin-bottom: 10px;
  padding-left: 2px;
}
.steps li::marker {
  color: var(--watercolor-red);
  font-weight: bold;
}

/* ===== 摇菜 ===== */
.btn-roll {
  margin: 18px auto 0;
  display: block;
  font-family: inherit;
  font-size: 20px;
  letter-spacing: 2px;
  color: #fffaef;
  background: linear-gradient(135deg, #d47454 0%, #c6603c 60%, #a9502f 100%);
  border: none;
  padding: 12px 36px;
  border-radius: 26px 22px 24px 20px / 22px 26px 20px 24px;
  box-shadow: 0 6px 18px rgba(169, 80, 47, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-roll:hover:not(:disabled) {
  transform: translateY(-1px) rotate(-0.5deg);
  box-shadow: 0 8px 22px rgba(169, 80, 47, 0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-roll:active:not(:disabled) { transform: scale(0.97); }
.btn-roll:disabled { opacity: 0.5; cursor: not-allowed; }
.roll-hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin: 6px 0 0;
  font-style: italic;
}

.combo-host {
  padding-top: 10px;
  padding-bottom: 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.combo-host.visible { max-height: 1200px; }
.combo-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 20px;
}

.combo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0 14px;
}
@media (min-width: 720px) {
  .combo-pair { gap: 24px; max-width: 720px; margin: 10px auto 14px; }
}

.combo-slot {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fffaef;
  border-radius: 20px 24px 22px 26px / 24px 20px 26px 22px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(198, 96, 60, 0.35);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease;
}
.combo-slot:hover { transform: translateY(-2px) rotate(-0.3deg); }
.combo-slot img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--paper-deep);
}
.combo-slot h3 {
  margin: 0;
  padding: 10px 12px 14px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}
.combo-slot-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--watercolor-red);
  color: #fffaef;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px 14px 12px 10px / 12px 10px 14px 12px;
  z-index: 2;
  letter-spacing: 1px;
}
.combo-slot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: rgba(234, 217, 180, 0.5);
  border: 2px dashed rgba(198, 96, 60, 0.4);
  color: var(--ink-soft);
}

.combo-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.btn-primary, .btn-ghost {
  font-family: inherit;
  font-size: 15px;
  padding: 8px 18px;
  border-radius: 18px 22px 20px 24px / 22px 18px 24px 20px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn-primary {
  background: var(--watercolor-red);
  color: #fffaef;
  border: none;
  box-shadow: 0 4px 12px rgba(169, 80, 47, 0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(138, 112, 80, 0.4);
}
.btn-primary:hover, .btn-ghost:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-ghost:active { transform: scale(0.97); }

/* ===== 菜品库入口 ===== */
.library-link {
  text-align: center;
  padding: 10px 20px 40px;
}
.library-link a {
  color: var(--watercolor-red);
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px dashed rgba(198, 96, 60, 0.5);
  padding-bottom: 2px;
}

/* ===== 菜品库页 ===== */
.library-header {
  padding-top: 30px;
  padding-bottom: 10px;
}
.library-header .back {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--watercolor-red);
  text-decoration: none;
  font-size: 14px;
}
.library-header h1 { font-size: 26px; }
.library-header h1::after { display: none; }

.search-wrap {
  max-width: 420px;
  margin: 10px auto 0;
  padding: 0 16px;
}
#search {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 16px;
  color: var(--ink);
  background: #fffaef;
  border: 1.5px solid rgba(138, 112, 80, 0.3);
  border-radius: 20px 24px 22px 26px / 24px 20px 26px 22px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#search:focus {
  border-color: var(--watercolor-red);
  box-shadow: 0 0 0 3px rgba(198, 96, 60, 0.15);
}
#search::placeholder { color: var(--ink-soft); font-style: italic; }

.category-count {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-soft);
  background: rgba(234, 217, 180, 0.6);
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 2px;
  font-weight: normal;
}

.btn-expand {
  display: block;
  margin: 14px auto 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--watercolor-red);
  background: transparent;
  border: 1px dashed rgba(198, 96, 60, 0.5);
  padding: 6px 18px;
  border-radius: 16px 20px 18px 22px / 20px 16px 22px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-expand:hover { background: rgba(198, 96, 60, 0.08); }
