:root {
  --primary: #E9782F;
  --primary-dark: #B95519;
  --primary-light: #FFF0E4;
  --bg: #FCF8F3;
  --card: #FFFFFF;
  --text: #232826;
  --muted: #7B8580;
  --line: #EFE3D8;
  --green: #365D4A;
  --shadow: 0 12px 35px rgba(77, 48, 27, .08);
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 248, 243, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(239, 227, 216, .65);
}
.nav-container {
  max-width:600px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { color: var(--text); text-decoration: none; font-size: 24px; font-weight: 900; letter-spacing: -.08em; }
.logo span { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-icon { width: 40px; height: 40px; border: 0; background: var(--card); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 5px 16px rgba(0,0,0,.05); color: var(--green); }
.btn-primary-sm { border: 0; background: var(--text); color: white; padding: 10px 17px; border-radius: 999px; font-weight: 800; }

.content { max-width:600px; margin: 0 auto; padding-bottom: 50px; }
.hero { padding: 34px 20px 18px; }
.kicker, .section-label { color: var(--primary-dark); font-size: 11px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 8px 0 8px; font-size: clamp(34px, 10vw, 54px); line-height: 1.02; letter-spacing: -.08em; }
.hero p { margin: 0 0 22px; color: var(--muted); font-size: 16px; max-width: 35em; }
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--card); padding: 8px; border-radius: 999px; box-shadow: var(--shadow); border: 1px solid rgba(239, 227, 216, .7); }
.search-bar input { min-width: 0; flex: 1; border: 0; outline: none; background: transparent; padding: 13px 12px 13px 16px; font-size: 16px; }
.search-bar button { border: 0; background: var(--primary); color: white; border-radius: 999px; padding: 12px 20px; font-weight: 900; box-shadow: 0 8px 18px rgba(233,120,47,.23); }

.filter-section { overflow-x: auto; white-space: nowrap; padding: 0 0 8px 20px; scrollbar-width: none; }
.filter-section::-webkit-scrollbar, .subs-grid::-webkit-scrollbar { display: none; }
.filter-scroll { display: inline-flex; gap: 10px; padding-right: 20px; }
.filter-tag { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 9px 17px; font-size: 14px; font-weight: 800; box-shadow: 0 4px 12px rgba(0,0,0,.03); }
.filter-tag.active { background: var(--green); color: white; border-color: var(--green); }

.subs-section, .recipe-section, .sub-list-section { margin-top: 22px; }
.section-header { display: flex; align-items: end; justify-content: space-between; padding: 0 20px 13px; }
.section-header.compact { padding-top: 4px; }
.section-header h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: -.04em; }
.section-header a { color: var(--primary-dark); text-decoration: none; font-weight: 800; font-size: 13px; }
.subs-grid { display: flex; gap: 12px; overflow-x: auto; padding: 0 20px 6px; scrollbar-width: none; }
.sub-card { min-width: 150px; background: var(--card); border: 1px solid var(--line); padding: 16px; border-radius: var(--radius-md); box-shadow: var(--shadow); }
.sub-card strong { display: block; font-size: 15px; }
.sub-card .arrow { color: var(--primary); font-weight: 950; margin: 6px 0; }
.sub-card small { color: var(--muted); }

.recipe-grid { display: grid; grid-template-columns:1fr 1fr; gap: 14px; padding: 0 20px; }
.recipe-card { border: 0; text-align: left; background: var(--card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease; color: inherit; }
.recipe-card:active { transform: scale(.97); }
.recipe-img { width: 100%; height: 128px; object-fit: cover; display: block; background: #eee; }
.recipe-info { padding: 13px; }
.recipe-info h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.25; letter-spacing: -.03em; }
.recipe-info p { margin: 0 0 10px; color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { background: var(--primary-light); color: var(--primary-dark); padding: 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 900; }.view-more{display:inline-block;margin-top:10px;color:var(--primary-dark);font-size:12px;font-weight:950}.recipe-detail,.detail-modal{max-height:calc(100vh - 42px);overflow-y:auto;}
.empty { grid-column: 1 / -1; text-align: center; background: var(--card); border: 1px dashed var(--line); color: var(--muted); padding: 25px; border-radius: var(--radius-md); }

.sub-list { padding: 0 20px; display: grid; gap: 10px; }
.sub-row { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 15px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.035); }
.sub-row span { color: var(--primary); font-weight: 950; }
.sub-row small { color: var(--muted); display: block; margin-top: 3px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(25, 28, 27, .42); display: none; justify-content: center; align-items:flex-end; z-index: 1000; padding-top: 40px; }
.modal-overlay.show { display: flex; }
.modal { display: none; width: 100%; max-width:600px; background: var(--card); border-radius: 26px 26px 0 0; padding: 22px; box-shadow: 0 -12px 40px rgba(0,0,0,.16); max-height: calc(100vh - 42px); overflow-y:auto; overscroll-behavior: contain; animation: slideUp .25s ease-out; }
.modal.active { display: block; }
@keyframes slideUp { from { transform: translateY(100%); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h3 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.close-modal { border: 0; background: #F4EFEA; border-radius: 999px; min-width: 38px; height: 38px; padding: 0 12px; font-size: 20px; color: var(--text); }
.back-modal { font-size: 15px; font-weight: 900; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 7px; color: var(--muted); font-weight: 800; font-size: 13px; }
.stack-form input, .stack-form textarea { width: 100%; border: 1px solid var(--line); background: #FFFDFC; border-radius: 15px; padding: 14px; outline: none; font-size: 16px; }
.form-row { display: grid; grid-template-columns:1fr 1fr; gap: 10px; }
.btn-block { border: 0; background: var(--primary); color: white; padding: 15px; border-radius: 16px; font-size: 16px; font-weight: 900; box-shadow: 0 9px 22px rgba(233,120,47,.25); }
.form-message { margin: 0; min-height: 22px; color: var(--muted); }
.detail-cover { width: 100%; height: 230px; object-fit: cover; border-radius: 22px; margin-bottom: 18px; }
.detail-body h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.06em; }
.detail-body p { color: var(--muted); }
.detail-box { background: var(--primary-light); border-radius: 18px; padding: 16px; margin-top: 16px; color: #74401D; }
.detail-box ol { margin: 8px 0 0; padding-left: 22px; }

@media (min-width: 720px) {
  .nav-container, .content, .modal { max-width: 1040px; }
  .content { padding-bottom: 80px; }
  .hero { padding: 58px 28px 24px; }
  .hero h1 { font-size: 64px; max-width: 760px; }
  .hero p { font-size: 18px; }
  .search-bar { max-width: 650px; }
  .recipe-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0 28px; }
  .recipe-img { height: 175px; }
  .section-header { padding-left: 28px; padding-right: 28px; }
  .subs-grid, .sub-list { padding-left: 28px; padding-right: 28px; }
  .modal-overlay { align-items: center; padding: 28px; }
  .modal { width: min(560px, 100%); border-radius: 28px; }
  .detail-modal { width: min(680px, 100%); }
}
