/* ===== Base & Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans SC', sans-serif;
  background-color: #F5F0E8;
  color: #333;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(45, 80, 22, 0.12);
  padding: 0 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.nav-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.15rem; font-weight: 700; color: #2D5016;
  text-decoration: none; white-space: nowrap;
}
.nav-brand .icon { font-size: 1.3rem; }
.nav-tabs { display: flex; gap: 0; align-items: stretch; height: 100%; }
.nav-tab {
  display: flex; align-items: center; padding: 0 1rem;
  font-size: 0.92rem; font-weight: 500; color: #666;
  cursor: pointer; border: none; background: none;
  border-bottom: 2.5px solid transparent;
  transition: color 0.2s, border-color 0.2s, font-weight 0.2s;
  white-space: nowrap; position: relative;
}
.nav-tab:hover { color: #2D5016; }
.nav-tab.active {
  color: #2D5016; font-weight: 700;
  border-bottom-color: #2D5016;
}
.nav-tab .badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #8B6914; color: #fff; font-size: 0.7rem;
  min-width: 1.2rem; height: 1.2rem; border-radius: 999px;
  margin-left: 0.3rem; padding: 0 0.3rem; font-weight: 600;
}

/* ===== Main Container ===== */
.main-container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* ===== Tab Panels ===== */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Hero / Home ===== */
.home-date {
  font-size: 1rem; color: #8B6914; text-align: center;
  margin-bottom: 0.5rem; font-weight: 500;
}
.home-title {
  font-size: 1.8rem; font-weight: 700; color: #2D5016;
  text-align: center; margin-bottom: 1.5rem;
  font-family: 'Noto Serif SC', serif;
}
.today-card {
  background: #fff; border-radius: 14px; padding: 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 2px solid rgba(139, 105, 20, 0.2);
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.today-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: linear-gradient(90deg, #2D5016, #8B6914);
}
.today-card:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.today-badge {
  display: inline-block; background: #2D5016; color: #fff;
  font-size: 0.75rem; padding: 0.2rem 0.7rem; border-radius: 999px;
  font-weight: 600; margin-bottom: 0.75rem;
}
.refresh-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  margin: 1.5rem auto 0;
  padding: 0.6rem 1.5rem;
  background: #fff; color: #2D5016; border: 1.5px solid #2D5016;
  border-radius: 999px; cursor: pointer; font-size: 0.9rem;
  font-weight: 500; transition: all 0.25s;
}
.refresh-btn:hover {
  background: #2D5016; color: #fff;
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(45,80,22,0.25);
}

/* ===== Cards ===== */
.exercise-card {
  background: #fff; border-radius: 10px; padding: 1.25rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.exercise-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.card-category {
  display: inline-block; font-size: 0.7rem; padding: 0.15rem 0.55rem;
  border-radius: 999px; font-weight: 600; margin-bottom: 0.5rem;
}
.card-category.meditation { background: #e8f5e9; color: #2D5016; }
.card-category.walking { background: #e3f2fd; color: #1565c0; }
.card-category.daily { background: #fff3e0; color: #e65100; }
.card-category.sleep { background: #ede7f6; color: #4527a0; }
.card-category.emotion { background: #fce4ec; color: #c62828; }
.card-category.visual { background: #e0f7fa; color: #00695c; }
.card-title {
  font-size: 1.08rem; font-weight: 700; color: #2D5016;
  margin-bottom: 0.3rem; font-family: 'Noto Serif SC', serif;
}
.card-meta {
  display: flex; gap: 0.75rem; font-size: 0.8rem; color: #999;
  margin-bottom: 0.5rem; flex-wrap: wrap;
}
.card-summary { font-size: 0.88rem; color: #555; line-height: 1.5; margin-bottom: 0.6rem; }
.card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.card-tag {
  font-size: 0.7rem; background: #F5F0E8; color: #8B6914;
  padding: 0.15rem 0.5rem; border-radius: 999px; font-weight: 500;
}
.card-actions { display: flex; gap: 0.5rem; align-items: center; }
.btn-fav {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; padding: 0.2rem; color: #ccc;
  transition: color 0.2s, transform 0.2s; line-height: 1;
}
.btn-fav.active { color: #f59e0b; }
.btn-fav:hover { transform: scale(1.15); color: #f59e0b; }
.btn-expand {
  background: none; border: 1px solid #ddd; border-radius: 6px;
  padding: 0.35rem 0.9rem; cursor: pointer; font-size: 0.82rem;
  color: #666; transition: all 0.2s; font-weight: 500;
}
.btn-expand:hover { border-color: #2D5016; color: #2D5016; background: #f9faf5; }
.btn-expand.expanded { border-color: #2D5016; color: #2D5016; background: #f0f5ea; }

/* ===== Steps Container (Guide Expander) ===== */
.steps-container {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.35s ease, margin 0.3s ease;
  margin-top: 0;
}
.steps-container.expanded {
  max-height: 4000px;
  opacity: 1;
  margin-top: 0.75rem;
}
.steps-inner {
  background: #fafaf7; border-radius: 8px; padding: 1rem 1.25rem;
  border: 1px solid rgba(45,80,22,0.1);
}
.step-item {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.step-item:last-child { border-bottom: none; }
.steps-container.expanded .step-item {
  opacity: 1;
  transform: translateY(0);
}
.step-phase {
  font-size: 0.8rem; font-weight: 700; color: #2D5016;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}
.step-text {
  font-size: 0.9rem; color: #444; line-height: 1.7;
  font-family: 'Noto Serif SC', serif;
}
.step-tip {
  margin-top: 0.75rem; padding: 0.5rem 0.75rem;
  background: rgba(139,105,20,0.08); border-radius: 6px;
  font-size: 0.82rem; color: #8B6914; font-style: italic;
  font-family: 'Noto Serif SC', serif;
}

/* ===== Category Group ===== */
.category-group { margin-bottom: 2rem; }
.category-header {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.2rem; font-weight: 700; color: #2D5016;
  margin-bottom: 0.75rem; padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(45,80,22,0.15);
}
.category-header .count { font-size: 0.8rem; color: #999; font-weight: 400; }
.category-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ===== Search & Filter ===== */
.search-box {
  width: 100%; max-width: 500px; padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1.5px solid #ddd; border-radius: 10px;
  font-size: 0.9rem; font-family: 'Noto Sans SC', sans-serif;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 0.75rem center no-repeat;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.search-box:focus { border-color: #2D5016; box-shadow: 0 0 0 3px rgba(45,80,22,0.1); }
.filter-tags {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.75rem 0 1.25rem;
}
.filter-tag {
  font-size: 0.8rem; padding: 0.3rem 0.8rem; border-radius: 999px;
  border: 1.5px solid #ddd; background: #fff; color: #666;
  cursor: pointer; font-weight: 500; transition: all 0.2s; white-space: nowrap;
}
.filter-tag:hover { border-color: #2D5016; color: #2D5016; }
.filter-tag.active { background: #2D5016; color: #fff; border-color: #2D5016; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: #999;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state .title { font-size: 1.1rem; font-weight: 600; color: #666; margin-bottom: 0.4rem; }
.empty-state .desc { font-size: 0.9rem; margin-bottom: 1.25rem; }
.empty-state .actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.empty-state-btn {
  padding: 0.5rem 1.25rem; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; border: none; transition: all 0.2s;
}
.empty-state-btn.primary { background: #2D5016; color: #fff; }
.empty-state-btn.primary:hover { background: #3d6b1e; }
.empty-state-btn.secondary { background: #fff; color: #2D5016; border: 1.5px solid #2D5016; }
.empty-state-btn.secondary:hover { background: #f0f5ea; }

/* ===== No Results ===== */
.no-results {
  text-align: center; padding: 2rem; color: #999; font-size: 0.95rem;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .nav-inner { height: auto; padding: 0.5rem 0; flex-direction: column; gap: 0.4rem; }
  .nav-tab { padding: 0 0.6rem; font-size: 0.82rem; }
  .main-container { padding: 1rem 0.75rem 3rem; }
  .home-title { font-size: 1.4rem; }
  .today-card { padding: 1.25rem; }
  .category-grid { grid-template-columns: 1fr; }
  .search-box { max-width: 100%; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1025px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
