:root {
  --ink: #0f2744;
  --ink-soft: #1a3a5c;
  --forest: #1f6f5b;
  --forest-deep: #155446;
  --gold: #c4a35a;
  --paper: #f7f4ec;
  --line: rgba(15, 39, 68, 0.12);
  --text: #1c2430;
  --muted: #5c6775;
  --font-display: "Fraunces", "Songti SC", "SimSun", serif;
  --font-body: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.main-body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
}

a { color: inherit; text-decoration: none; }

.ec-home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ec-wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* Top */
.ec-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
}

.ec-brand img {
  display: block;
  height: 34px;
  width: auto;
}

.ec-nav {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  color: rgba(247, 242, 232, 0.86);
  font-size: 14px;
  font-weight: 600;
}
.ec-nav a { transition: color 0.2s ease; }
.ec-nav a:hover { color: #fff; }
.ec-nav-cta {
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(196, 163, 90, 0.18);
  color: var(--gold) !important;
  border: 1px solid rgba(196, 163, 90, 0.35);
}

/* Hero — one composition, brand first */
.ec-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 120px 0 80px;
  color: #f7f2e8;
  background:
    radial-gradient(1100px 620px at 14% 20%, rgba(31, 111, 91, 0.34), transparent 55%),
    radial-gradient(900px 480px at 86% 78%, rgba(196, 163, 90, 0.16), transparent 52%),
    linear-gradient(145deg, #0b1d33 0%, #0f2744 42%, #163652 100%);
}

.ec-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ec-hero-bg .page {
  position: absolute;
  border-radius: 4px 14px 14px 4px;
  background: linear-gradient(110deg, rgba(243, 239, 230, 0.14), rgba(243, 239, 230, 0.04));
  border: 1px solid rgba(243, 239, 230, 0.14);
  transform-origin: left center;
  animation: ecPageFloat 8s ease-in-out infinite;
}
.ec-hero-bg .p1 {
  width: min(38vw, 380px);
  height: min(52vw, 520px);
  right: 6%;
  top: 10%;
  transform: rotate(8deg);
}
.ec-hero-bg .p2 {
  width: min(34vw, 340px);
  height: min(48vw, 480px);
  right: 14%;
  top: 14%;
  transform: rotate(14deg);
  animation-delay: -2s;
  opacity: 0.85;
}
.ec-hero-bg .p3 {
  width: min(30vw, 300px);
  height: min(44vw, 440px);
  right: 22%;
  top: 18%;
  transform: rotate(20deg);
  animation-delay: -4s;
  opacity: 0.65;
}
.ec-hero-bg .grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 0.6px, transparent 0.7px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
}

.ec-hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  max-width: 560px;
  margin-left: max(20px, calc((100% - 1120px) / 2));
  animation: ecRiseIn 0.85s ease both;
}

.ec-hero-logo {
  display: block;
  height: clamp(52px, 8vw, 76px);
  width: auto;
  margin: 0 0 22px;
}

.ec-hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: rgba(247, 242, 232, 0.96);
}

.ec-hero p {
  margin: 0 0 28px;
  max-width: 36ch;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(247, 242, 232, 0.78);
}

.ec-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.ec-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.ec-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  color: #fff;
}

.ec-btn-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 4px;
  color: var(--gold);
  font-weight: 600;
  border-bottom: 1px solid rgba(196, 163, 90, 0.45);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ec-btn-ghost:hover {
  color: #e0c27a;
  border-color: #e0c27a;
}
.ec-btn-ghost.dark {
  color: var(--ink);
  border-color: rgba(15, 39, 68, 0.28);
}
.ec-btn-ghost.dark:hover {
  color: var(--forest);
  border-color: var(--forest);
}

.ec-btn-outline {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid rgba(15, 39, 68, 0.18);
  color: var(--ink);
  font-weight: 700;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ec-btn-outline:hover {
  background: rgba(15, 39, 68, 0.04);
  border-color: rgba(15, 39, 68, 0.32);
}

/* Sections */
.ec-block {
  padding: 64px 0 40px;
  animation: ecRiseIn 0.7s ease 0.08s both;
}

.ec-head {
  margin-bottom: 28px;
}
.ec-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.ec-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.ec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 20px;
}

.ec-book {
  display: block;
  transition: transform 0.25s ease;
}
.ec-book:hover { transform: translateY(-4px); }
.ec-book-cover {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(160deg, #e8e2d4, #d9d1bf);
  box-shadow:
    0 18px 40px rgba(15, 39, 68, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
.ec-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.ec-book:hover .ec-book-cover img { transform: scale(1.03); }

.ec-book-meta {
  display: block;
  padding: 14px 2px 0;
}
.ec-book-meta strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 4px;
}
.ec-book-meta em {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

.ec-more {
  margin-top: 32px;
  text-align: center;
}

.ec-empty {
  text-align: center;
  padding: 40px 20px 20px;
  color: var(--muted);
}
.ec-empty img {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  opacity: 0.9;
}
.ec-empty p { margin: 0 0 18px; }

/* Flow */
.ec-flow {
  background:
    linear-gradient(180deg, rgba(15, 39, 68, 0.04), transparent 50%),
    var(--paper);
}
.ec-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.ec-steps li {
  padding-top: 8px;
  border-top: 2px solid rgba(31, 111, 91, 0.35);
}
.ec-step-no {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--forest);
}
.ec-steps strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  color: var(--ink);
}
.ec-steps p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* CTA band */
.ec-cta-band {
  padding: 40px 0;
  background: linear-gradient(120deg, #123055 0%, #0f2744 55%, #155446 140%);
  color: #f7f2e8;
}
.ec-cta-band .ec-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.ec-cta-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  margin-bottom: 6px;
}
.ec-cta-copy span {
  color: rgba(247, 242, 232, 0.72);
  font-size: 14px;
}
.ec-cta-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.ec-cta-actions .ec-btn-ghost {
  color: rgba(247, 242, 232, 0.9);
  border-color: rgba(247, 242, 232, 0.35);
}
.ec-cta-actions .ec-btn-ghost:hover {
  color: #fff;
  border-color: #fff;
}

/* Footer */
.ec-foot {
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ec-foot .ec-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ec-foot-brand img {
  height: 28px;
  width: auto;
  display: block;
}
.ec-foot p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

@keyframes ecPageFloat {
  0%, 100% { transform: rotate(var(--r, 8deg)) translateY(0); }
  50% { transform: rotate(var(--r, 8deg)) translateY(-10px); }
}
.ec-hero-bg .p1 { --r: 8deg; }
.ec-hero-bg .p2 { --r: 14deg; }
.ec-hero-bg .p3 { --r: 20deg; }

@keyframes ecRiseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .ec-grid { grid-template-columns: repeat(2, 1fr); }
  .ec-steps { grid-template-columns: 1fr; gap: 22px; }
  .ec-hero { min-height: auto; padding: 110px 0 64px; }
  .ec-nav a:not(.ec-nav-cta):nth-child(-n+2) { display: none; }
}

@media (max-width: 560px) {
  .ec-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .ec-book-meta strong { font-size: 13px; }
  .ec-top { width: calc(100% - 28px); }
  .ec-wrap { width: calc(100% - 28px); }
}
