/* SanJieAI public site — homepage / games */
:root {
  --paper: #f4f0e7;
  --paper-2: #fbf8f0;
  --surface: #fffdf8;
  --ink: #17201b;
  --ink-2: #2f3a33;
  --muted: #687169;
  --line: #ded6c7;
  --line-dark: #c9c0ae;
  --green: #145c4b;
  --green-2: #0f473a;
  --green-soft: #dbe8de;
  --amber: #b96f2e;
  --amber-soft: #f3e2cc;
  --dark: #121815;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow: 0 24px 60px -34px rgba(23, 32, 27, .35);
  --radius: 26px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -8%, #e9efe5 0%, transparent 60%),
    radial-gradient(760px 440px at 92% 4%, #f5e7d4 0%, transparent 58%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(23, 32, 27, .12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .12;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  z-index: -1;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--green);
  color: #f8f4e9;
  font-family: var(--serif);
  font-size: 21px;
  box-shadow: 0 8px 20px -10px rgba(20, 92, 75, .7);
}
.brand-word { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word strong { font-size: 16px; letter-spacing: .06em; }
.brand-word small { margin-top: 2px; font-family: var(--mono); font-size: 8.5px; letter-spacing: .28em; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 18px; }
.site-nav a {
  padding: 7px 13px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2);
  transition: background .18s ease, color .18s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(20, 92, 75, .08); color: var(--green); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.admin-login {
  border: 1px solid var(--line-dark);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  letter-spacing: .02em;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.admin-login:hover { color: var(--green); border-color: var(--green); background: rgba(20, 92, 75, .05); }
.admin-link {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 7px 14px;
  background: var(--green); color: #f7f3e8;
  font-size: 12.5px; font-weight: 600;
}
.admin-link span { font-size: 12px; opacity: .7; }

/* ---------------- buttons ---------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 999px; padding: 13px 22px;
  font-size: 14px; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--green); color: #f8f4e9; box-shadow: 0 16px 34px -20px rgba(20, 92, 75, .9); }
.button-primary:hover { background: var(--green-2); box-shadow: 0 20px 38px -18px rgba(20, 92, 75, .85); }
.button-quiet { border-color: var(--line-dark); background: rgba(255, 255, 255, .45); color: var(--ink-2); }
.button-quiet:hover { border-color: var(--ink-2); background: var(--surface); }
.button span { font-size: 15px; }

/* ---------------- hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, .7fr);
  gap: clamp(34px, 6vw, 90px);
  align-items: end;
  padding-top: clamp(58px, 9vh, 104px);
  padding-bottom: clamp(48px, 7vh, 82px);
}
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  color: var(--green);
  text-transform: uppercase;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(20, 92, 75, .12); }
.hero h1 {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(58px, 8.2vw, 106px);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.hero h1 em { font-style: normal; color: var(--green); }
.lede {
  max-width: 560px;
  margin-top: 24px;
  font-size: clamp(15.5px, 1.5vw, 18px);
  line-height: 1.85;
  color: var(--muted);
}
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-index {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.index-head, .index-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; color: var(--muted);
}
.index-head { border-bottom: 1px solid var(--line); }
.index-foot { border-top: 1px solid var(--line); }
.index-row {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .18s ease, padding .18s ease;
}
.index-row:last-of-type { border-bottom: 0; }
.index-row:hover { background: rgba(20, 92, 75, .06); padding-left: 23px; }
.index-no { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 22px; }
.index-name { display: flex; flex-direction: column; line-height: 1.35; font-family: var(--serif); font-size: 23px; }
.index-name small { margin-top: 4px; font-family: var(--sans); font-size: 11.5px; color: var(--muted); letter-spacing: .01em; }
.index-arrow { margin-left: auto; color: var(--green); font-size: 18px; }

/* ---------------- feature cards ---------------- */
.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-bottom: 18px;
}
.feature {
  position: relative;
  min-height: 470px;
  padding: clamp(24px, 3.4vw, 38px);
  border-radius: var(--radius);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  transition: transform .24s ease, box-shadow .24s ease;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature-tools { background: linear-gradient(145deg, #e6eee6, #d8e5da 70%); border-color: #cbdacd; color: #18241c; }
.feature-games { background: linear-gradient(145deg, #18211d, #0e1411 72%); border-color: #26332c; color: #f3eee3; }
.feature-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feature-no { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; opacity: .55; }
.feature-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; opacity: .62; }
.feature h2 { margin-top: 20px; font-family: var(--serif); font-size: clamp(34px, 3.7vw, 50px); font-weight: 600; line-height: 1.08; letter-spacing: -.035em; }
.feature h2 span { display: block; margin-top: 4px; font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: .12em; opacity: .62; }
.feature p { max-width: 430px; margin-top: 16px; font-size: 13.5px; line-height: 1.8; opacity: .75; }
.feature-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; padding: 0; list-style: none; }
.feature-tags li { padding: 4px 10px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; opacity: .62; }
.feature-link {
  margin-top: auto;
  padding-top: 26px;
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 700;
}
.feature-link span { transition: transform .18s ease; }
.feature:hover .feature-link span { transform: translateX(5px); }
.feature-art {
  position: absolute; z-index: -1; pointer-events: none;
  right: -16px; bottom: 54px; width: 240px; height: 190px;
}
.tools-art { display: grid; grid-template-columns: repeat(3, 62px); gap: 8px; transform: rotate(-8deg); opacity: .5; }
.tool-tile {
  height: 62px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid rgba(20, 60, 45, .22);
  background: rgba(255, 255, 255, .34);
  font-family: var(--mono); font-size: 12px; color: #274d3c;
}
.tool-tile:nth-child(2), .tool-tile:nth-child(5) { background: rgba(20, 92, 75, .16); }
.games-art {
  display: grid; place-items: center;
  font-family: var(--sans); font-size: 120px;
  transform: rotate(-12deg);
  opacity: .52;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, .5));
}
.game-teaser {
  margin-top: 20px;
  border: 1px solid rgba(243, 238, 227, .16);
  border-radius: 15px;
  overflow: hidden;
  background: rgba(255, 255, 255, .035);
}
.game-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; }
.game-row + .game-row { border-top: 1px solid rgba(243, 238, 227, .1); }
.game-row.is-muted { opacity: .48; }
.game-emoji { font-size: 23px; line-height: 1; }
.game-row strong { display: block; font-size: 13px; }
.game-row small { display: block; margin-top: 1px; font-size: 10.5px; opacity: .55; }
.game-state { margin-left: auto; font-size: 10px; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(255, 209, 102, .4); color: #ffd166; }
.game-state.live { background: rgba(255, 209, 102, .12); }

/* ---------------- status strip / page ---------------- */
.status-strip {
  margin: 28px auto 64px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  color: var(--muted);
}
.status-strip .label { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--green); }
.status-strip p { flex: 1; font-size: 13.5px; }
.status-strip a { color: var(--green); font-size: 13px; font-weight: 700; white-space: nowrap; }

.page-head { padding: clamp(54px, 8vh, 96px) 0 32px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: end; }
.page-head h1 { margin-top: 16px; font-family: var(--serif); font-size: clamp(50px, 7vw, 86px); font-weight: 600; line-height: 1.04; letter-spacing: -.04em; }
.page-head h1 em { font-style: normal; color: var(--green); }
.page-head .lede { margin-top: 16px; }
.page-head-side { justify-self: end; border-left: 1px solid var(--line); padding-left: 24px; max-width: 320px; }
.page-head-side p { font-size: 12.5px; color: var(--muted); }
.page-head-side strong { display: block; margin-top: 8px; font-family: var(--serif); font-size: 19px; color: var(--ink); }

.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-bottom: 28px; }
.game-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 46px -34px rgba(23, 32, 27, .35);
  transition: transform .22s ease, box-shadow .22s ease;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.game-cover {
  min-height: 230px;
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 22px;
  overflow: hidden;
  isolation: isolate;
}
.game-cover-smash {
  background:
    radial-gradient(520px 260px at 75% 20%, rgba(255, 209, 102, .24), transparent 70%),
    linear-gradient(150deg, #1b2420, #0d1310);
  color: #f7f1e3;
}
.game-cover-smash::before {
  content: "🔨"; position: absolute; right: 8%; top: 2%; font-size: 150px;
  transform: rotate(-18deg); filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .55)); opacity: .9;
}
.game-cover-smash::after {
  content: ""; position: absolute; inset: 18% 6% auto auto; width: 170px; height: 170px;
  border: 1px solid rgba(255, 209, 102, .25); border-radius: 50%;
}
.game-cover-price {
  background: linear-gradient(150deg, #eee6d8, #d8c9b4);
  color: #2b2419;
}
.game-cover-price::before {
  content: "📈"; position: absolute; right: 7%; top: 4%; font-size: 140px;
  transform: rotate(6deg); filter: grayscale(.2); opacity: .55;
}
.game-cover .cover-label { position: relative; z-index: 1; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; opacity: .65; }
.game-cover .cover-badge { position: relative; z-index: 1; border: 1px solid currentColor; border-radius: 999px; padding: 3px 9px; font-size: 10px; opacity: .8; }
.game-info { padding: clamp(22px, 2.6vw, 30px); display: flex; flex-direction: column; flex: 1; }
.game-meta { font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; color: var(--muted); }
.game-info h2 { margin-top: 8px; font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 600; letter-spacing: -.025em; }
.game-info > p { margin-top: 10px; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.game-facts { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; padding: 0; list-style: none; }
.game-facts li { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 10.5px; color: var(--muted); }
.game-actions { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.game-actions .button { padding: 10px 18px; font-size: 13px; }
.text-link { font-size: 12.5px; color: var(--green); font-weight: 700; }
.game-card.is-soon { opacity: .82; }
.game-card.is-soon:hover { transform: none; box-shadow: 0 18px 46px -34px rgba(23, 32, 27, .35); }
.tag-soon { display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font-size: 12px; font-weight: 700; }

/* ---------------- footer ---------------- */
.site-footer { margin-top: 54px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper-2) 68%, transparent); }
.footer-main { display: flex; justify-content: space-between; gap: 28px; padding: 34px 0 24px; flex-wrap: wrap; }
.footer-brand { max-width: 340px; }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { color: var(--muted); font-size: 12.5px; }
.footer-columns { display: flex; gap: clamp(30px, 6vw, 80px); flex-wrap: wrap; }
.footer-col { min-width: 120px; }
.footer-col h3 { font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; color: var(--muted); font-weight: 500; }
.footer-col a, .footer-col span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.footer-col a:hover { color: var(--green); }
.footer-legal {
  border-top: 1px solid var(--line);
  padding: 16px 0 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 11px;
}
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--green); }
.footer-legal .beian { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer-legal .beian img { height: 1em; width: auto; display: inline-block; vertical-align: -2px; margin-right: 3px; }

/* ---------------- admin dialog (homepage) ---------------- */
dialog.admin-dialog {
  width: min(430px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(10, 18, 14, .6);
}
dialog.admin-dialog::backdrop { background: rgba(12, 18, 15, .45); backdrop-filter: blur(5px); }
.dialog-inner { padding: 30px 28px 26px; position: relative; }
.dialog-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 6px; }
.dialog-kicker { font-family: var(--mono); font-size: 9.5px; letter-spacing: .25em; color: var(--green); }
.dialog-title { margin-top: 8px; font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -.02em; }
.dialog-desc { margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.field { margin-top: 20px; display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 11.5px; font-weight: 650; color: var(--ink-2); letter-spacing: .04em; }
.field input {
  width: 100%; border: 1px solid var(--line-dark); border-radius: 10px;
  padding: 11px 13px; background: var(--paper-2); color: var(--ink);
  font: inherit; font-size: 14px;
}
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(20, 92, 75, .1); }
.form-error { min-height: 18px; margin-top: 8px; color: #a63c2e; font-size: 11.5px; }
.dialog-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }
.dialog-actions .button { padding: 10px 18px; font-size: 13px; }
.dialog-note { margin-top: 14px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }

/* ---------------- intro animations ---------------- */
.reveal { animation: reveal .7s cubic-bezier(.2, .7, .2, 1) both; }
.reveal.delay-1 { animation-delay: .08s; }
.reveal.delay-2 { animation-delay: .16s; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-index { max-width: 520px; }
  .showcase { grid-template-columns: 1fr; }
  .feature { min-height: 420px; }
  .page-head { grid-template-columns: 1fr; }
  .page-head-side { justify-self: start; border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .game-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .container { width: calc(100% - 32px); }
  .header-inner { min-height: 64px; gap: 12px; }
  .site-nav { margin-left: 0; gap: 0; }
  .site-nav a { padding: 6px 9px; font-size: 13px; }
  .brand-word small { display: none; }
  .admin-login { padding: 6px 10px; font-size: 11.5px; }
  .admin-link { padding: 6px 10px; font-size: 11.5px; }
  .hero { padding-top: 44px; gap: 34px; }
  .hero h1 { font-size: clamp(52px, 15vw, 76px); }
  .feature { min-height: 0; padding: 24px 20px; }
  .feature-art { opacity: .3; right: -30px; }
  .feature h2 { font-size: clamp(32px, 8vw, 42px); }
  .feature-games { min-height: 460px; }
  .footer-main { flex-direction: column; }
  .footer-columns { width: 100%; justify-content: space-between; }
  .footer-legal { flex-direction: column; }
  .dialog-inner { padding: 26px 20px 22px; }
  .page-head { padding-top: 42px; }
}
@media (max-width: 480px) {
  .header-inner { flex-wrap: wrap; padding: 9px 0; }
  .header-actions { margin-left: auto; }
  .brand-word strong { font-size: 14px; }
  .site-nav { order: 3; width: 100%; border-top: 1px solid var(--line); padding-top: 6px; }
  .site-nav a { padding: 5px 10px; }
  .hero-actions .button { width: 100%; }
  .index-name { font-size: 20px; }
  .game-cover { min-height: 190px; }
  .game-cover-smash::before { font-size: 110px; }
}
