*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: #e8e8ff;
  color: #222;
}

a { color: #000080; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────────────────── */
.tm-header {
  background: #000080;
  color: #fff;
  text-align: center;
  padding: 20px 16px;
}
.tm-header h1 { font-size: 1.8rem; letter-spacing: 1px; }
.tm-header p  { font-size: .85rem; opacity: .75; margin-top: 4px; }
.tm-header a  { color: #aac; font-size: .85rem; }
.tm-header a:hover { color: #fff; }

/* ── Container ───────────────────────────────────────────────────────── */
.tm-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

/* ── Note banner ─────────────────────────────────────────────────────── */
.tm-note {
  background: #fff3cd;
  border-left: 4px solid #f0a500;
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  font-size: .88rem;
  margin-bottom: 24px;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.tm-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ── Intro card (thumbnail + text) ───────────────────────────────────── */
.tm-intro {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  flex-wrap: wrap;
}
.tm-intro img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.tm-intro p { flex: 1 1 200px; }

/* ── Balloons needed ─────────────────────────────────────────────────── */
.tm-balloons {
  background: #d32f2f;
  color: #fff;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: .9rem;
}
.tm-balloons strong { display: block; margin-bottom: 4px; }
.tm-balloons a { color: #ffd0d0; }

/* ── Steps ───────────────────────────────────────────────────────────── */
.tm-steps { list-style: none; }
.tm-step {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  display: flex;
  overflow: hidden;
  flex-wrap: wrap;
}
.tm-step-text {
  flex: 1 1 220px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tm-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000080;
  color: #fff;
  font-weight: bold;
  font-size: .75rem;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.tm-step-img {
  background: #c8c8c8;
  flex: 0 0 auto;
}
.tm-step-img img {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: cover;
}
.tm-step-img a { display: block; }
.tm-video-badge {
  display: block;
  text-align: center;
  background: #000080;
  color: #fff;
  font-size: .75rem;
  padding: 3px;
}

/* ── Figure / index grid ─────────────────────────────────────────────── */
.tm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.tm-grid-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}
.tm-grid-item:hover { box-shadow: 0 4px 16px rgba(0,0,128,.18); text-decoration: none; }
.tm-grid-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tm-grid-item-body { padding: 12px 14px; flex: 1; }
.tm-grid-item-body h3 { font-size: 1rem; color: #000080; margin-bottom: 6px; }
.tm-grid-item-body p  { font-size: .82rem; line-height: 1.5; color: #444; }

/* ── TOC list ────────────────────────────────────────────────────────── */
.tm-toc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.tm-toc-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  transition: box-shadow .2s;
}
.tm-toc-item:hover { box-shadow: 0 4px 16px rgba(0,0,128,.18); text-decoration: none; }
.tm-toc-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.tm-toc-item span { font-weight: bold; font-size: .92rem; color: #000080; }
.tm-toc-bonus { font-size: .78rem; color: #c00; font-weight: normal; display: block; }

/* ── Back link ───────────────────────────────────────────────────────── */
.tm-back {
  display: inline-block;
  margin-top: 24px;
  color: #000080;
  text-decoration: none;
  font-weight: bold;
  font-size: .9rem;
}
.tm-back:hover { text-decoration: underline; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.tm-footer {
  background: #000080;
  color: #aac;
  text-align: center;
  font-size: .8rem;
  padding: 14px 16px;
}
.tm-footer a { color: #aac; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .tm-step { flex-direction: column; }
  .tm-step-img img { width: 100%; height: auto; }
  .tm-intro img { width: 100px; height: 100px; }
  .tm-header h1 { font-size: 1.4rem; }
}
