:root {
  color-scheme: light;
  --ink: #202635;
  --muted: #687083;
  --pink: #f472b6;
  --pink-soft: #fce7f3;
  --purple: #a78bfa;
  --mint: #5eead4;
  --yellow: #fcd34d;
  --cream: #fff9f0;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(244, 114, 182, 0.2);
  --shadow: 0 22px 60px rgba(125, 83, 111, 0.13);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(244, 114, 182, 0.16), transparent 25rem),
    radial-gradient(circle at 88% 10%, rgba(94, 234, 212, 0.16), transparent 24rem),
    var(--cream);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.content-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  padding: 0.8rem max(1rem, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.content-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: max-content;
}

.content-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--mint), var(--pink), var(--purple));
  box-shadow: inset 0 -5px rgba(61, 38, 65, 0.13), 0 10px 24px rgba(244, 114, 182, 0.22);
}

.content-brand strong,
.content-brand small { display: block; line-height: 1.05; }
.content-brand strong { font-size: 1.2rem; }
.content-brand small { margin-top: 0.2rem; color: var(--pink); font-size: 0.7rem; }

.content-nav-links {
  display: flex;
  gap: 0.45rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.content-nav-links a {
  min-width: max-content;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.content-nav-links a:hover,
.content-nav-links a[aria-current="page"] { color: #db2777; background: #fff1f7; }

.content-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3rem;
}

.detail-hero,
.game-frame-card,
.content-section,
.tool-shell,
.tool-hero,
.hub-entry-section {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.detail-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 1.5rem;
  align-items: center;
  min-height: 350px;
  padding: clamp(1.4rem, 5vw, 3.4rem);
  overflow: hidden;
}

.detail-hero::after {
  position: absolute;
  right: -5rem;
  bottom: -8rem;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.24), rgba(244, 114, 182, 0.25));
  content: "";
}

.eyebrow,
.badge {
  margin: 0 0 0.7rem;
  color: #db2777;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-hero h1,
.tool-hero h1 {
  max-width: 820px;
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 6.5vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.detail-hero p:not(.eyebrow),
.tool-hero p,
.section-heading p,
.rule-card p,
.faq-list p,
.tool-intro,
.helper-text,
.tool-note {
  color: var(--muted);
  line-height: 1.75;
}

.detail-actions,
.tool-actions,
.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.primary-link,
.secondary-link,
.primary-button,
.secondary-button {
  display: inline-grid;
  min-height: 48px;
  place-items: center;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 15px;
  font-weight: 900;
  cursor: pointer;
}

.primary-link,
.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 14px 28px rgba(244, 114, 182, 0.24);
}

.secondary-link,
.secondary-button {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.hero-tile-stack {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 70px);
  justify-content: center;
  gap: 0.7rem;
  transform: rotate(-4deg);
}

.hero-tile-stack span {
  display: grid;
  height: 90px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 18px;
  color: #8f3159;
  background: linear-gradient(155deg, white, #fff4f8 68%, #eadfff);
  box-shadow: inset 0 -8px rgba(78, 51, 77, 0.09), 0 14px 25px rgba(91, 61, 88, 0.15);
  font-size: 1.2rem;
  font-weight: 900;
}

.game-frame-card,
.content-section,
.tool-shell,
.hub-entry-section { margin-top: 1rem; padding: clamp(1rem, 3vw, 1.55rem); }

.frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.frame-header h2,
.section-heading h2,
.tool-shell h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.35rem); letter-spacing: -0.035em; }
.frame-header p { margin: 0.2rem 0 0; color: var(--muted); }

.game-frame-wrap {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, #fff, #f9ecf5);
}

.game-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: white;
}

.frame-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.section-heading { max-width: 820px; margin-bottom: 1.1rem; }
.section-heading h2 { margin-bottom: 0.55rem; }
.section-heading p { margin: 0; }

.rule-grid,
.guide-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.rule-card,
.guide-card,
.tool-side-card,
.notation-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
}

.rule-card h3,
.guide-card h3 { margin: 0 0 0.45rem; }
.rule-card p { margin: 0; }
.rule-card ul { margin: 0; padding-left: 1.2rem; color: var(--muted); line-height: 1.65; }
.rule-card li + li { margin-top: 0.35rem; }

.rule-index {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 0.75rem;
  place-items: center;
  border-radius: 12px;
  color: #be185d;
  background: var(--pink-soft);
  font-weight: 900;
}

.faq-list { display: grid; gap: 0.65rem; }
.faq-list details { padding: 0.95rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.faq-list summary { cursor: pointer; font-weight: 900; }
.faq-list p { margin: 0.7rem 0 0; }

.guide-card {
  display: grid;
  min-height: 190px;
  align-content: space-between;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.guide-card:hover { transform: translateY(-4px); box-shadow: 0 18px 35px rgba(244, 114, 182, 0.16); }
.guide-card-icon { display: grid; width: 54px; height: 62px; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #fff, var(--pink-soft)); color: #be185d; font-size: 1.3rem; font-weight: 900; box-shadow: inset 0 -6px rgba(93, 56, 78, 0.08); }
.guide-card p { color: var(--muted); line-height: 1.55; }
.guide-card strong { color: #db2777; }

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1rem;
  align-items: center;
  padding: clamp(1.4rem, 5vw, 3rem);
}

.notation-card code,
.generated-code { padding: 0.15rem 0.35rem; border-radius: 7px; color: #9d174d; background: var(--pink-soft); font-family: ui-monospace, Consolas, monospace; font-weight: 900; }
.notation-card p { color: var(--muted); line-height: 1.65; }

.tool-grid { grid-template-columns: minmax(0, 1fr) 300px; }
.checker-form label { display: block; margin-bottom: 0.45rem; font-weight: 900; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; }
.input-row input { min-width: 0; padding: 0.8rem 0.9rem; border: 2px solid var(--line); border-radius: 14px; color: var(--ink); background: white; font-family: ui-monospace, Consolas, monospace; font-weight: 800; }
.input-row input:focus { border-color: var(--pink); outline: 3px solid rgba(244, 114, 182, 0.16); }
.helper-text { margin: 0.35rem 0 0; font-size: 0.82rem; }
.sample-row { align-items: center; margin-top: 0.75rem; }
.sample-row button { padding: 0.4rem 0.62rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; cursor: pointer; }

.tile-rack { display: flex; flex-wrap: wrap; gap: 0.32rem; min-height: 82px; margin-top: 0.9rem; padding: 0.7rem; border-radius: 16px; background: rgba(94, 234, 212, 0.09); }
.notation-tile { display: grid; width: 45px; height: 62px; place-items: center; border: 1px solid rgba(83, 54, 70, 0.12); border-radius: 9px; background: linear-gradient(155deg, #fff, #fffaf3 65%, #e9dfd4); box-shadow: inset 0 -5px rgba(64, 42, 50, 0.1), 0 5px 10px rgba(85,45,60,0.12); }
.notation-tile strong { font-size: 1.05rem; }
.notation-tile small { margin-top: -0.25rem; font-size: 0.66rem; font-weight: 900; }
.suit-m { color: #b2344b; } .suit-p { color: #216bad; } .suit-s { color: #26805d; } .suit-z { color: #5a3d75; }

.tool-result { display: grid; gap: 0.3rem; margin-top: 0.8rem; padding: 0.9rem 1rem; border-left: 5px solid #8b7eb5; border-radius: 14px; color: var(--muted); background: white; line-height: 1.55; }
.tool-result strong { color: var(--ink); }
.tool-result.success { border-left-color: #2a9b6d; background: #effcf6; }
.tool-result.warning { border-left-color: #dc9d26; background: #fff9e5; }
.tool-result.error { border-left-color: #d94f68; background: #fff0f4; }

.check-list { display: grid; gap: 0.65rem; margin: 0; padding: 0; list-style: none; }
.check-list li { display: grid; gap: 0.12rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.check-list span { color: var(--muted); font-size: 0.84rem; }
.tool-note { padding: 0.8rem; border-radius: 13px; background: #fff8d8; font-size: 0.85rem; }
.generated-code { display: inline-block; margin-top: 0.75rem; overflow-wrap: anywhere; }

.content-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem 1.2rem; width: min(1180px, calc(100% - 2rem)); margin: 0 auto 2rem; padding: 1rem; border-top: 1px solid var(--line); color: var(--muted); }
.content-footer a { color: #db2777; font-weight: 900; }

@media (max-width: 900px) {
  .detail-hero,
  .tool-hero { grid-template-columns: 1fr; }
  .hero-tile-stack { display: none; }
  .rule-grid,
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-side-card { order: -1; }
  .game-frame-wrap { min-height: 560px; }
  .game-frame-wrap iframe { height: 640px; }
}

@media (max-width: 640px) {
  .content-nav { align-items: flex-start; flex-wrap: wrap; }
  .content-nav-links { width: 100%; margin-left: 0; }
  .detail-hero h1,
  .tool-hero h1 { font-size: clamp(2.25rem, 13vw, 3.8rem); }
  .rule-grid,
  .guide-grid { grid-template-columns: 1fr; }
  .frame-header { align-items: flex-start; flex-direction: column; }
  .game-frame-wrap { min-height: 520px; overflow-x: auto; }
  .game-frame-wrap iframe { min-width: 760px; height: 620px; transform-origin: top left; }
  .input-row { grid-template-columns: 1fr; }
  .input-row .primary-button { width: 100%; }
  .notation-tile { width: 40px; height: 56px; }
}
