:root {
  --ep-bg-top: #ffe88a;
  --ep-bg-bottom: #fff8df;
  --ep-shell: rgba(255, 252, 244, 0.96);
  --ep-text: #24344d;
  --ep-muted: #66788f;
  --ep-orange: #ff9a3c;
  --ep-orange-dark: #e07f22;
  --ep-blue: #4f8cff;
  --ep-shadow: 0 12px 40px rgba(120, 86, 20, 0.12);
  --ep-radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ep-text);
  background: linear-gradient(180deg, var(--ep-bg-top) 0%, var(--ep-bg-bottom) 100%);
  line-height: 1.55;
}

a {
  color: var(--ep-text);
}

.ep-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ep-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(120, 86, 20, 0.08);
  box-shadow: 0 4px 16px rgba(120, 86, 20, 0.06);
}

.ep-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0;
}

.ep-brand {
  font-weight: 900;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ep-text);
}

.ep-topbar-title {
  flex: 1;
  text-align: center;
  font-weight: 800;
  color: var(--ep-muted);
  font-size: 0.95rem;
}

.ep-dashboard-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb347, var(--ep-orange));
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ep-orange-dark);
}

.ep-dashboard-link:hover {
  text-decoration: none;
  filter: brightness(1.03);
}

.ep-nav {
  position: sticky;
  top: 62px;
  z-index: 999;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 0 14px;
}

.ep-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ep-text);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(120, 86, 20, 0.08);
}

.ep-nav a:hover {
  background: #fff4bf;
  text-decoration: none;
}

.ep-main {
  flex: 1;
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 8px 0 28px;
}

#global-player {
  position: sticky;
  top: 112px;
  z-index: 998;
  margin: 0 auto 14px;
  padding: 12px 16px;
  border-radius: 22px;
  background: #ffffff;
  text-align: center;
  box-shadow: var(--ep-shadow);
}

#global-player button,
#global-player select {
  margin: 4px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: #fff4bf;
  color: var(--ep-text);
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.page {
  max-width: none;
  margin: 0 0 16px;
  padding: 22px;
  border-radius: var(--ep-radius);
  background: var(--ep-shell);
  box-shadow: var(--ep-shadow);
}

.page h1,
.page h2,
.page h3 {
  color: var(--ep-text);
}

.page h1 {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-align: center;
}

.center {
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  padding: 14px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(120, 86, 20, 0.08);
}

.card img,
.page img,
.story-card img {
  width: 100%;
  border-radius: 16px;
}

.jp {
  color: var(--ep-muted);
  font-size: 0.92em;
  font-weight: 600;
}

.story-card {
  padding: 18px;
  border-radius: 22px;
  margin: 18px 0;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(120, 86, 20, 0.08);
}

.story-card h3 {
  text-align: left;
  margin-top: 0;
  color: var(--ep-orange-dark);
}

.story-card > p > a {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ece4ff;
  font-weight: 800;
  text-decoration: none;
}

audio {
  width: 100%;
  margin: 8px 0;
}

.ep-hero-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9a3c, #ffb84d);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.ep-progress {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: 16px;
  background: #fff4bf;
  font-weight: 800;
}

.app-footer {
  margin-top: auto;
}

@media (max-width: 760px) {
  .ep-topbar-title {
    order: 3;
    width: 100%;
    text-align: left;
  }

  .ep-nav {
    top: 98px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }

  #global-player {
    top: 150px;
  }
}
