@charset "UTF-8";
:root {
  --background: #f8f7ef; --surface: #ffffff; --ink: #294b43; --muted: #83918a;
  --primary: #4b8b70; --primary-soft: #e8f2e7; --accent: #f3bd9c; --line: #e3e8db; --board: #f1f4e9;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--background); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background-image: radial-gradient(var(--line) .7px, transparent .7px); background-size: 9px 9px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 5px; }
button { touch-action: manipulation; }
button, a { -webkit-user-select: none; user-select: none; }
.page-shell { max-width: 1160px; margin: 0 auto; padding: 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 110px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.brand-icon { background: var(--primary-soft); border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; width: 37px; height: 37px; font-size: 21px; transform: rotate(-7deg); }
.top-actions { display: flex; gap: 25px; align-items: center; font-size: 12px; }
.offline-label { color: var(--muted); }
.offline-label::before { content: ""; display: inline-block; width: 5px; height: 5px; background: var(--primary); border-radius: 50%; margin-right: 7px; vertical-align: 2px; }
.text-button { background: none; border: 0; padding: 12px 0 12px 12px; font-size: 12px; }
.text-button::after { content: "↗"; margin-left: 8px; }
main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 548px); column-gap: 85px; padding: 57px 0 49px; align-items: start; }
.intro { padding-top: 18px; }
.eyebrow { display: flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: .14em; font-weight: 600; }
.little-spark { color: var(--primary); font-size: 19px; }
h1 { font-family: "HanziPen SC", "STKaiti", "KaiTi", serif; font-size: clamp(52px, 5.6vw, 70px); line-height: 1.2; white-space: pre-line; font-weight: 600; letter-spacing: -.035em; margin: 22px 0 19px; }
.subtitle { font-size: 13px; line-height: 1.95; color: var(--muted); max-width: 280px; white-space: pre-line; margin: 0; }
.theme-scene { height: 170px; position: relative; margin-top: 3px; width: 275px; }
.orbit { display: block; border: 1px dashed var(--line); position: absolute; border-radius: 50%; }
.orbit-one { width: 240px; height: 100px; top: 35px; left: 0; transform: rotate(-17deg); }
.orbit-two { width: 130px; height: 130px; top: 12px; left: 57px; }
.theme-art span { position: absolute; display: grid; place-items: center; filter: drop-shadow(0 7px 5px #294b4310); }
.theme-art span:nth-child(1) { font-size: 62px; top: 43px; left: 38px; transform: rotate(-15deg); }
.theme-art span:nth-child(2) { font-size: 35px; top: 18px; left: 148px; transform: rotate(16deg); }
.theme-art span:nth-child(3) { font-size: 38px; top: 95px; left: 146px; transform: rotate(-12deg); }
.theme-art span:nth-child(4) { font-size: 34px; top: 68px; left: 216px; transform: rotate(14deg); }
.scene-dot { position: absolute; border-radius: 50%; background: var(--accent); }
.dot-one { width: 8px; height: 8px; top: 41px; left: 231px; }
.dot-two { width: 5px; height: 5px; top: 132px; left: 51px; background: var(--primary); }
.scene-spark { position: absolute; color: var(--primary); font-size: 21px; }
.spark-one { top: 33px; left: 5px; }.spark-two { top: 124px; left: 223px; }
.note { position: relative; background: var(--primary-soft); border-radius: 3px 15px 15px 15px; padding: 21px 22px 18px; max-width: 300px; transform: rotate(-2deg); margin: 1px 0 28px; }
.note-pin { display: block; position: absolute; left: 114px; top: -8px; height: 16px; width: 57px; background: var(--accent); opacity: .68; transform: rotate(5deg); }
.note-eyebrow { font-size: 10px; letter-spacing: .16em; color: var(--primary); }
.note p { margin: 12px 0 8px; font-family: "STKaiti", "KaiTi", serif; font-size: 17px; line-height: 1.7; white-space: pre-line; }
.note-signature { display: block; text-align: right; color: var(--muted); font-size: 10px; }
.tile-legend { display: flex; flex-wrap: wrap; gap: 15px; font-size: 10px; color: var(--muted); }
.legend-item { display: flex; gap: 5px; align-items: center; }.legend-item span:first-child { font-size: 16px; }
.level-tabs { display: flex; gap: 6px; margin: 0 4px 15px; overflow-x: auto; scrollbar-width: thin; }
.level-tab { flex: 1 0 calc((100% - 12px) / 3); min-width: 0; display: flex; gap: 8px; align-items: center; justify-content: center; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 12px 5px; font-size: 12px; color: var(--muted); }
.level-tab .tab-number { font-family: Georgia, serif; font-size: 13px; opacity: .8; }
.level-tab.active { background: var(--primary-soft); color: var(--ink); border-color: var(--line); font-weight: 600; }
.level-tab.completed .tab-number::after { content: "·"; margin-left: 3px; color: var(--primary); }
.game-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 27px 29px 23px; box-shadow: 0 8px 0 -4px var(--primary-soft), 0 16px 35px -23px #294b4330; }
.game-heading { display: flex; justify-content: space-between; align-items: center; }
.section-kicker { font-size: 9px; font-weight: 600; letter-spacing: .17em; color: var(--muted); }
h2 { font-size: 19px; font-weight: 600; letter-spacing: .04em; margin: 6px 0 0; }
.icon-button { border-radius: 50%; width: 35px; height: 35px; background: transparent; border: 1px solid var(--line); font-family: Georgia, serif; font-size: 16px; }
.icon-button:hover { background: var(--primary-soft); }
.stats { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); margin: 25px 0 11px; }
.time-stat, .pair-stat { display: flex; align-items: center; gap: 7px; }
.stats strong { color: var(--ink); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; margin-left: 3px; }
.clock-icon { border: 1.3px solid currentColor; display: inline-block; border-radius: 50%; width: 11px; height: 11px; position: relative; }
.clock-icon::after { content: ""; position: absolute; width: 3px; height: 4px; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; top: 1px; left: 4px; }
.time-track { height: 4px; border-radius: 5px; background: var(--primary-soft); overflow: hidden; }
#time-fill { height: 100%; width: 100%; background: var(--primary); border-radius: inherit; transition: width .25s linear; }
.time-low #time-fill { background: var(--accent); }.time-low #time-value { color: var(--primary); }
.board-wrap { position: relative; padding: 19px; margin: 22px -6px 0; background: var(--board); border: 1px solid var(--line); border-radius: 18px; }
.board { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 9px; position: relative; }
.tile { display: grid; place-items: center; padding: 0; position: relative; aspect-ratio: 1; border: 1px solid #294b4310; border-bottom: 3px solid #294b4315; border-radius: 12px; background: var(--tile-color, var(--surface)); transition: transform .15s, box-shadow .15s, opacity .15s; font-size: clamp(25px, 3.2vw, 38px); }
.tile:hover:not(:disabled) { transform: translateY(-2px) rotate(-2deg); box-shadow: 0 5px 9px #294b4310; }
.tile.selected { box-shadow: 0 0 0 2px var(--primary); transform: translateY(-2px) rotate(-3deg); border-color: var(--primary); }
.tile.hinted { animation: hint-pulse .9s ease-in-out infinite alternate; box-shadow: 0 0 0 2px var(--primary); }
.tile.empty { visibility: hidden; pointer-events: none; }
.tile img { position: absolute; width: 77%; height: 77%; object-fit: contain; }.tile img[hidden] { display: none; }
.tile .emoji[hidden] { display: none; }
.connection { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.connection polyline { stroke: var(--primary); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; fill: none; filter: drop-shadow(0 0 3px var(--primary-soft)); }
.status-line { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; margin: 3px 0 8px; }
.status-line p { margin: 0; font-size: 10px; line-height: 1.6; color: var(--muted); text-align: center; }
.status-dot { flex: 0 0 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.game-tools { display: flex; gap: 9px; border-top: 1px dashed var(--line); padding-top: 16px; }
.tool-button { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; background: var(--primary-soft); border: 1px solid var(--line); border-radius: 10px; min-height: 43px; padding: 5px; font-size: 11px; }
.tool-button:hover:not(:disabled) { border-color: var(--primary); }
.tool-icon { font-size: 21px; line-height: 1; }.tool-count { display: grid; place-items: center; min-width: 17px; height: 17px; border-radius: 50%; background: var(--surface); font-size: 9px; }
.restart-button { background: transparent; }
.board-footnote { text-align: center; font-size: 10px; letter-spacing: .035em; color: var(--muted); margin: 23px 0 0; }
footer { padding: 23px 0 27px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .05em; display: flex; justify-content: space-between; }
dialog { border: 1px solid var(--line); color: var(--ink); border-radius: 24px; padding: 0; width: min(380px, calc(100% - 36px)); box-shadow: 0 30px 100px #294b4326; background: var(--surface); }
dialog::backdrop { background: #233d3654; backdrop-filter: blur(5px); }
.dialog-content { padding: 34px 30px; text-align: center; }.dialog-icon { font-size: 44px; }
.dialog-content h2 { margin: 13px 0; font-family: "STKaiti", "KaiTi", serif; font-size: 30px; }
#dialog-body { font-size: 13px; line-height: 1.95; color: var(--muted); white-space: pre-line; }
#dialog-extra { display: flex; gap: 18px; justify-content: center; font-size: 12px; color: var(--primary); margin: 22px 0; }
.primary-button { width: 100%; min-height: 46px; border: 0; border-radius: 12px; background: var(--primary); color: white; font-size: 13px; }.primary-button:hover { filter: brightness(.95); }
.fatal { max-width: 600px; margin: 10vh auto; padding: 30px; line-height: 1.8; }
@keyframes hint-pulse { to { transform: translateY(-3px); filter: brightness(1.03); } }
@media (min-width: 761px) { .intro { animation: arrive .6s both; }.game-section { animation: arrive .6s .12s both; } }
@keyframes arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1000px) {
  .page-shell { padding: 0 30px; } main { column-gap: 36px; grid-template-columns: minmax(240px, 1fr) minmax(0, 480px); }
  .game-card { padding: 24px; }.note { max-width: 260px; }.theme-scene { transform: scale(.9); transform-origin: left center; }
  .tile-legend { gap: 10px; }.level-tab { font-size: 11px; }
}
@media (max-width: 760px) {
  .page-shell { max-width: 520px; padding: 0 21px; }.topbar { height: 64px; }.brand { font-size: 13px; gap: 8px; }.brand-icon { width: 31px; height: 31px; border-radius: 10px; font-size: 18px; }
  .offline-label { display: none; }.top-actions { gap: 0; }.text-button { font-size: 11px; }
  main { display: block; padding: 20px 0 30px; }.intro { position: relative; padding: 0 0 17px; }.eyebrow { font-size: 9px; letter-spacing: .11em; gap: 6px; }.little-spark { font-size: 15px; }
  h1 { white-space: normal; font-size: clamp(33px, 8.2vw, 43px); letter-spacing: -.03em; margin: 10px 0 8px; max-width: 100%; }
  .subtitle { font-size: 11px; white-space: normal; max-width: none; line-height: 1.8; }
  .theme-scene { display: none; }.note { display: none; }.tile-legend { display: none; }
  .level-tabs { margin: 0 0 12px; gap: 4px; }.level-tab { padding: 11px 4px; font-size: 11px; gap: 7px; border-radius: 9px; }
  .game-card { padding: 22px 18px 18px; border-radius: 20px; }h2 { font-size: 17px; }.section-kicker { font-size: 8px; }.icon-button { width: 32px; height: 32px; }
  .stats { margin-top: 18px; }.board-wrap { padding: 15px; margin: 16px -4px 0; border-radius: 14px; }.board { gap: 7px; }.tile { border-radius: 10px; font-size: clamp(23px, 7.6vw, 36px); }
  .board.dense { gap: 5px; }.board.dense .tile { border-radius: 7px; font-size: clamp(20px, 5.5vw, 28px); }
  .tool-button { font-size: 10px; min-height: 42px; gap: 5px; border-radius: 9px; }.game-tools { gap: 7px; padding-top: 14px; }.tool-icon { font-size: 19px; }
  .status-line { min-height: 40px; margin-bottom: 2px; }.status-line p { font-size: 9px; }.board-footnote { margin-top: 19px; font-size: 9px; }
  footer { font-size: 9px; gap: 10px; padding: 21px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
