/* ==========================================================================
   EGGTART BAKERY · 云端烘焙坊 - Core Style & Design System
   Domain: https://dantayun.homes/
   Color System: Cream White (#FFF9EF), Caramel Brown (#B77843), Egg Gold (#F4C653)
   ========================================================================== */

:root {
  --cream-white: #FFF9EF;
  --cream-subtle: #FFFDF9;
  --caramel-brown: #B77843;
  --caramel-hover: #9E6333;
  --egg-gold: #F4C653;
  --egg-gold-soft: #FDE8A0;
  --baking-dark: #754625;
  --oatmeal-beige: #F4E4CB;
  --oatmeal-border: #E8D5BC;
  --card-white: #FFFFFF;
  --text-dark: #493527;
  --text-muted: #947B65;
  --cta-orange: #D98A36;
  --cta-hover: #C27627;
  --cranberry-accent: #C25B68;
  --purple-rice: #64385E;
  
  --shadow-sm: 0 2px 8px rgba(117, 70, 37, 0.06);
  --shadow-md: 0 8px 24px rgba(117, 70, 37, 0.08);
  --shadow-lg: 0 16px 40px rgba(117, 70, 37, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --font-main: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Plus Jakarta Sans", -apple-system, sans-serif;
  
  --container-max: 1240px;
  --header-height: 76px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--cream-white);
  color: var(--text-dark);
}

body {
  font-family: var(--font-main);
  line-height: 1.65;
  background-color: var(--cream-white);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--caramel-brown);
  text-decoration: none;
  transition: all 0.25s ease;
}

a:hover {
  color: var(--cta-orange);
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.25s ease;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Utility Badges */
.chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: var(--oatmeal-beige);
  color: var(--baking-dark);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  border: 1px solid var(--oatmeal-border);
}

.chapter-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cta-orange);
}

.section-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 36px;
}

/* Floating Cream Navbar */
.bakery-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 239, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--oatmeal-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.bakery-header.scrolled {
  box-shadow: var(--shadow-sm);
  background: rgba(255, 249, 239, 0.98);
}

.bakery-header .container.navbar-inner {
  max-width: 1400px;
  padding: 0 24px;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: nowrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-brand img {
  height: 44px;
  width: auto;
  max-width: 180px;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.1vw, 18px);
  flex-wrap: nowrap;
  flex-shrink: 1;
}

.nav-link {
  font-size: 0.90rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 6px 4px;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.nav-link:hover, .nav-link.active {
  color: var(--baking-dark);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--egg-gold);
  transition: all 0.25s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 80%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

.btn-primary {
  background-color: var(--cta-orange);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(217, 138, 54, 0.32);
}

.btn-primary:hover {
  background-color: var(--cta-hover);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(217, 138, 54, 0.42);
}

.btn-secondary {
  background-color: var(--card-white);
  color: var(--baking-dark);
  border: 1px solid var(--oatmeal-border);
}

.btn-secondary:hover {
  background-color: var(--oatmeal-beige);
  color: var(--baking-dark);
  transform: translateY(-1px);
}

.btn-gold {
  background-color: var(--egg-gold);
  color: var(--baking-dark);
  font-weight: 800;
}

.btn-gold:hover {
  background-color: #EBB637;
  transform: translateY(-2px);
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-toggle span {
  display: block;
  height: 2.5px;
  width: 100%;
  background-color: var(--baking-dark);
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* Mobile Menu Drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream-white);
  padding: 24px;
  overflow-y: auto;
  z-index: 99;
  border-top: 1px solid var(--oatmeal-border);
}

.mobile-drawer.active {
  display: block;
}

.mobile-drawer .nav-link {
  display: block;
  font-size: 1.15rem;
  padding: 14px 8px;
  border-bottom: 1px solid var(--oatmeal-border);
}

.mobile-drawer .btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-size: 1.05rem;
}

/* Bakery Chapter Sections */
.bakery-chapter {
  padding: 72px 0;
  position: relative;
}

.bakery-chapter:nth-child(even) {
  background-color: #FAF4E8;
}

/* Sticky Mobile Quick Buy Bar */
.mobile-quick-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 249, 239, 0.98);
  border-top: 1px solid var(--oatmeal-border);
  padding: 10px 16px;
  z-index: 98;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -4px 16px rgba(117, 70, 37, 0.08);
}

.mobile-quick-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-quick-info {
  display: flex;
  flex-direction: column;
}

.mobile-quick-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mobile-quick-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cta-orange);
}

.mobile-quick-btn {
  flex: 1;
  max-width: 200px;
  padding: 10px 16px;
  font-size: 0.92rem;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
