:root {
  --bg: #090a0a;
  --surface: #111313;
  --surface-2: #161818;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.105);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f1eb;
  --text-soft: #d3d0c8;
  --muted: #979991;
  --accent: #d8b68c;
  --accent-soft: rgba(216, 182, 140, 0.15);
  --green: #9bd39a;
  --max: 1240px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 0%, rgba(216, 182, 140, .08), transparent 29rem),
    radial-gradient(circle at 8% 40%, rgba(255, 255, 255, .035), transparent 26rem),
    var(--bg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 10, 10, .88);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(var(--max), calc(100% - 32px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 176px;
  height: 58px;
  flex: 0 0 auto;
  overflow: hidden;
  background-image: url("/static/feeling_logo_white.png");
  background-size: 332px 332px;
  background-position: -77px -139px;
  background-repeat: no-repeat;
}

.brand-subtitle {
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .16em;
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-header-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #17110c;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text-soft);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(155, 211, 154, .72);
}

.page-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 84px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 44px;
  align-items: end;
  padding: 16px 0 40px;
}

.hero-copy-wrap { max-width: 850px; }

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .15em;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  max-width: 900px;
  font-size: clamp(2.45rem, 5.6vw, 5rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 700;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 700;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-copy {
  margin-bottom: 0;
  max-width: 720px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.8;
}

.scope-card {
  min-height: 150px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, var(--accent-soft), rgba(255,255,255,.025));
}

.scope-card span { color: var(--muted); }
.scope-card strong {
  margin: 7px 0 4px;
  font-size: 1.55rem;
  line-height: 1.2;
}
.scope-label {
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.filter-panel {
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
}

.filter-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 17px 20px;
}

.filter-row + .filter-row { border-top: 1px solid var(--line); }

.filter-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-copy strong { font-size: .94rem; }

.filter-kicker {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.author-tabs,
.period-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filter-pill,
.period-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  border-radius: 999px;
  padding: 8px 15px;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text-soft);
  font-size: .91rem;
  font-weight: 600;
  transition: .16s ease;
}

.filter-pill:hover,
.period-tabs button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.filter-pill.active,
.period-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #17120e;
}

.filter-count {
  margin-left: 5px;
  opacity: .72;
  font-size: .78em;
}

.metrics-grid,
.dashboard-grid {
  display: grid;
  gap: 14px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.dashboard-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

.dashboard-grid-main {
  grid-template-columns: 1.35fr .65fr;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025));
  border-radius: 22px;
}

.metric-card { padding: 20px 21px; }

.metric-label {
  display: block;
  color: var(--text-soft);
  font-size: .91rem;
  font-weight: 650;
}

.metric-card small {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.metric-card strong {
  display: block;
  margin: 7px 0 3px;
  font-size: clamp(2rem, 4.3vw, 3.4rem);
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -.04em;
}

.panel { padding: 24px; }

.panel-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.panel-note {
  margin: 0;
  max-width: 290px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}

.chart-wrap { height: 350px; }
.chart-wrap.small { height: 290px; }

.ranking-list,
.specialty-list {
  display: grid;
}

.rank-item,
.specialty-item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.rank-item:first-child,
.specialty-item:first-child { border-top: 0; }

.rank-row,
.specialty-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rank-name {
  color: var(--text-soft);
  font-size: .96rem;
  font-weight: 600;
}

.rank-count {
  color: var(--muted);
  font-size: .83rem;
  font-weight: 650;
}

.specialty-meter {
  height: 5px;
  margin-top: 11px;
  border-radius: 99px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
}

.specialty-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f1dcc2);
}

.ai-panel { margin-bottom: 44px; }

.ai-copy {
  max-width: 920px;
  white-space: pre-line;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.9;
}

.gallery-section { padding-top: 6px; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.recipe-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  transition: .18s ease;
}

.recipe-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.recipe-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #151717;
}

.recipe-body { padding: 17px; }

.recipe-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.recipe-author {
  color: var(--text-soft);
  font-weight: 700;
}

.flavor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.flavor-chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: .83rem;
  font-weight: 600;
}

.flavor-chip:hover {
  color: var(--text);
  border-color: var(--accent);
}

.flavor-chip span {
  margin-left: 3px;
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  padding: 24px 0;
  font-size: .92rem;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.76);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: 84vh;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  padding: 28px;
  background: #101212;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 17px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 1.35rem;
  cursor: pointer;
}

.partner-grid {
  display: grid;
  gap: 0;
  margin: 18px 0 28px;
}

.partner-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  color: var(--text-soft);
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .scope-card { min-height: 0; max-width: 360px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid,
  .dashboard-grid-main { grid-template-columns: 1fr; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .header-inner,
  .page-shell { width: min(var(--max), calc(100% - 22px)); }
  .brand-logo { width: 135px; height: 48px; background-size: 256px 256px; background-position: -60px -107px; }
  .brand-subtitle { display: none; }
  .page-shell { padding-top: 28px; }
  .hero { padding-bottom: 28px; }
  h1 { font-size: clamp(2.15rem, 10vw, 3.2rem); }
  .filter-row { grid-template-columns: 1fr; gap: 10px; }
  .filter-copy { flex-direction: row; align-items: baseline; gap: 8px; }
  .panel-heading,
  .section-heading { display: block; }
  .panel-note { margin-top: 8px; }
}

@media (max-width: 560px) {
  .site-header { position: static; }
  .header-inner { min-height: 68px; }
  .live-chip { padding: 7px 9px; font-size: .69rem; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 2.15rem; }
  .panel { padding: 18px; }
  .recipe-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 300px; }
  .chart-wrap.small { height: 250px; }
}
