:root {
  --ink: #14213d;
  --muted: #64748b;
  --line: #dce5ea;
  --paper: #f7faf9;
  --card: rgba(255, 255, 255, .9);
  --green: #087f5b;
  --green-dark: #056044;
  --green-soft: #e9f7f1;
  --blue: #1769aa;
  --amber: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --shadow: 0 18px 55px rgba(25, 55, 48, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(8, 127, 91, .13), transparent 26rem),
    radial-gradient(circle at 92% 17%, rgba(23, 105, 170, .1), transparent 24rem),
    var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(1160px, calc(100% - 36px)); margin: auto; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}
.brand { font-size: 18px; font-weight: 850; letter-spacing: .01em; }
.brand i {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(8, 127, 91, .12);
}
.nav-links { display: flex; flex-wrap: wrap; gap: 22px; color: #475569; font-size: 14px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--green); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, .72fr);
  align-items: center;
  gap: 52px;
  padding: 74px 0 68px;
}
.eyebrow { color: var(--green); font-weight: 850; letter-spacing: .17em; font-size: 13px; }
h1 {
  margin: 12px 0 20px;
  font-size: clamp(46px, 7vw, 82px);
  line-height: 1.06;
  letter-spacing: -.05em;
}
.lead { max-width: 720px; color: #526174; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  font-weight: 750;
  cursor: pointer;
}
.button.primary { color: white; background: var(--green); border-color: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button:hover { border-color: var(--green); color: var(--green); }
.button.primary:hover { color: white; }

.identity-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border-radius: 30px;
  color: white;
  background: linear-gradient(145deg, #0d3b36, #087f5b 62%, #1769aa);
  box-shadow: 0 26px 76px rgba(8, 89, 67, .25);
}
.identity-card::after {
  content: "RZ";
  position: absolute;
  right: -12px;
  bottom: -48px;
  color: rgba(255, 255, 255, .08);
  font-size: 150px;
  font-weight: 900;
  line-height: 1;
}
.identity-card small { color: rgba(255, 255, 255, .68); letter-spacing: .12em; }
.identity-card h2 { margin: 8px 0 0; font-size: 35px; letter-spacing: -.035em; }
.identity-card p { margin: 5px 0 24px; color: rgba(255, 255, 255, .75); }
.identity-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.identity-tags span { padding: 7px 11px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 12px; }

section { padding: 30px 0 58px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.section-head h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.section-link { color: var(--green); font-weight: 750; white-space: nowrap; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--card);
  box-shadow: 0 12px 38px rgba(31, 55, 48, .07);
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -52px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--tone);
  opacity: .12;
}
.feature-card.about { --tone: var(--green); }
.feature-card.blog { --tone: var(--blue); }
.feature-card.projects { --tone: var(--amber); }
.card-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  color: white;
  background: var(--tone);
  font-size: 19px;
  font-weight: 900;
}
.feature-card h3 { margin: 24px 0 7px; font-size: 26px; }
.feature-card p { margin: 0; color: var(--muted); }
.feature-card footer { position: absolute; left: 27px; bottom: 24px; color: var(--tone); font-weight: 800; }

.search-panel, .article-card, .game-shell {
  border: 1px solid var(--line);
  border-radius: 27px;
  background: rgba(255, 255, 255, .83);
  box-shadow: var(--shadow);
}
.search-panel { padding: 25px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
}
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box button {
  border: 0;
  border-radius: 12px;
  padding: 11px 19px;
  color: white;
  background: var(--green);
  font-weight: 750;
  cursor: pointer;
}
.search-results { display: grid; margin-top: 14px; }
.search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px 5px;
  border-bottom: 1px solid var(--line);
}
.result-type {
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}
.search-result strong { display: block; overflow-wrap: anywhere; }
.search-result small { color: var(--muted); }
.search-result:hover strong { color: var(--green); }
.search-empty { padding: 32px 8px 14px; color: var(--muted); text-align: center; }

.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.game-card {
  position: relative;
  min-height: 285px;
  overflow: hidden;
  padding: 30px;
  border-radius: 27px;
  color: white;
  box-shadow: 0 20px 58px rgba(20, 33, 61, .16);
}
.game-card.wordle { background: linear-gradient(145deg, #163b2f, #087f5b); }
.game-card.twenty-four { background: linear-gradient(145deg, #17345c, #1769aa); }
.game-card.yousya {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #0b1320, #17345c 58%, #087f5b);
}
.game-card .game-mark { font-size: 54px; font-weight: 900; letter-spacing: .08em; opacity: .92; }
.game-card h3 { margin: 26px 0 6px; font-size: 27px; }
.game-card p { max-width: 470px; margin: 0; color: rgba(255, 255, 255, .76); }
.game-card footer { position: absolute; left: 30px; bottom: 26px; font-weight: 800; }
.game-card::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 220px;
  height: 220px;
  border: 38px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
}

.projects-empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 35px;
  border: 1px dashed #a9bbc3;
  border-radius: 25px;
  color: var(--muted);
  background: rgba(255, 255, 255, .47);
  text-align: center;
}
.projects-empty b { display: block; color: var(--ink); font-size: 22px; }
.project-list { display: grid; gap: 14px; }
.project-entry {
  display: grid;
  grid-template-columns: minmax(150px, .4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.project-entry b { font-size: 18px; }
.project-entry span { color: var(--muted); }

.article-layout { padding: 52px 0 80px; }
.article-card { padding: clamp(25px, 6vw, 64px); }
.article-card .article-kicker { color: var(--green); font-weight: 850; letter-spacing: .15em; font-size: 12px; }
.article-card h1 { max-width: 850px; font-size: clamp(38px, 6vw, 68px); }
.article-card h2 { margin-top: 2.3em; padding-bottom: .35em; border-bottom: 1px solid var(--line); font-size: 27px; }
.article-card h3 { margin-top: 1.8em; font-size: 21px; }
.article-card p { color: #334155; }
.article-card blockquote {
  margin: 26px 0;
  padding: 18px 21px;
  border-left: 4px solid var(--green);
  border-radius: 0 15px 15px 0;
  background: var(--green-soft);
  color: #385163;
}
.account-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin: 22px 0; }
.account-card { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.account-card small { display: block; color: var(--muted); }
.handle { font-weight: 900; }
.cf-grandmaster { color: #e00000; }
.cf-im { color: #ff8c00; }
.atcoder-yellow { color: #c0c000; }

.awards-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 23px 0 14px; }
.filter-button {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  cursor: pointer;
}
.filter-button.active, .filter-button:hover { color: white; border-color: var(--green); background: var(--green); }
.award-list { display: grid; gap: 11px; }
.award {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
.award[hidden] { display: none; }
.award-year { color: var(--green); font-weight: 900; }
.award-name strong { display: block; }
.award-name small { color: var(--muted); }
.medal { padding: 5px 9px; border-radius: 999px; text-align: center; font-size: 12px; font-weight: 850; }
.medal.gold { color: #8a5700; background: #fff0b8; }
.medal.silver { color: #526174; background: #e9eef2; }
.medal.bronze { color: #864a24; background: #f5d8c2; }
.medal.first { color: #fff; background: linear-gradient(135deg, #087f5b, #1769aa); }

.game-page { padding: 35px 0 76px; }
.game-shell { padding: clamp(20px, 5vw, 42px); }
.game-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.game-header h1 { margin: 0; font-size: clamp(36px, 6vw, 62px); }
.game-header p { margin: 6px 0 0; color: var(--muted); }
.status {
  min-height: 28px;
  margin: 16px 0;
  color: var(--green);
  font-weight: 800;
  text-align: center;
}

.wordle-board {
  display: grid;
  gap: 7px;
  width: min(350px, 100%);
  margin: 22px auto;
}
.wordle-row { display: grid; grid-template-columns: repeat(var(--word-length, 5), 1fr); gap: 7px; }
.game-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.game-options label { color: var(--muted); font-size: 14px; }
.game-options select {
  padding: 10px 13px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.letter-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: white;
  font-size: clamp(24px, 6vw, 35px);
  font-weight: 900;
  text-transform: uppercase;
}
.letter-tile.filled { border-color: #8393a7; }
.letter-tile.correct { color: white; border-color: #15805d; background: #15805d; }
.letter-tile.present { color: white; border-color: #c58b18; background: #c58b18; }
.letter-tile.absent { color: white; border-color: #718096; background: #718096; }
.keyboard { display: grid; gap: 7px; max-width: 650px; margin: 25px auto 0; }
.key-row { display: flex; justify-content: center; gap: 6px; }
.key {
  min-width: 38px;
  height: 51px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: #dce5ea;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  text-transform: uppercase;
}
.key.wide { min-width: 68px; }
.key.correct { color: white; background: #15805d; }
.key.present { color: white; background: #c58b18; }
.key.absent { color: white; background: #718096; }
.wordle-help { max-width: 650px; margin: 18px auto 0; color: var(--muted); text-align: center; font-size: 13px; }

.puzzle-numbers, .operator-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  min-height: 72px;
  margin: 16px 0;
}
.number-card, .operator-card {
  display: grid;
  place-items: center;
  min-width: 68px;
  height: 68px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  color: white;
  background: linear-gradient(145deg, #087f5b, #0a6d50);
  box-shadow: 0 10px 25px rgba(8, 127, 91, .2);
  font-size: 25px;
  font-weight: 900;
  cursor: grab;
  user-select: none;
}
.operator-card {
  min-width: 58px;
  height: 58px;
  color: var(--blue);
  background: #e9f1fa;
  box-shadow: none;
}
.number-card:active, .operator-card:active { cursor: grabbing; }
.number-card.used { display: none; }
.operation-zone {
  display: grid;
  grid-template-columns: 1fr 80px 1fr auto;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 28px auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f8fbfa;
}
.drop-slot {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 2px dashed #b9c8cf;
  border-radius: 17px;
  color: var(--muted);
  background: white;
  text-align: center;
}
.drop-slot.drag-over { border-color: var(--green); background: var(--green-soft); }
.drop-slot .number-card, .drop-slot .operator-card { pointer-events: none; }
.operation-zone .button { min-height: 52px; }
.history-list {
  display: grid;
  gap: 7px;
  max-width: 720px;
  margin: 20px auto 0;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 14px;
}
.game-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.victory {
  color: white;
  background: linear-gradient(135deg, #087f5b, #1769aa);
  border-radius: 14px;
  padding: 12px 18px;
}
.site-footer { margin-top: 30px; padding: 35px 0 45px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 215px; }
  .game-grid, .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .shell { width: min(100% - 22px, 1160px); }
  .nav { align-items: flex-start; padding: 17px 0; }
  .nav-links { justify-content: flex-end; gap: 12px; }
  .hero { padding: 34px 0 45px; gap: 30px; }
  h1 { font-size: 45px; }
  .lead { font-size: 16px; }
  .section-head { align-items: start; flex-direction: column; }
  .search-panel { padding: 17px; }
  .search-result { grid-template-columns: auto minmax(0, 1fr); }
  .search-result > :last-child { display: none; }
  .award { grid-template-columns: 88px minmax(0, 1fr) 72px; gap: 10px; padding: 14px 12px; }
  .award-year { font-size: 12px; }
  .project-entry { grid-template-columns: 1fr; gap: 7px; }
  .game-header { flex-direction: column; }
  .key { min-width: 28px; height: 46px; padding: 0 7px; font-size: 11px; }
  .key.wide { min-width: 52px; }
  .operation-zone { grid-template-columns: 1fr 60px 1fr; }
  .operation-zone .button { grid-column: 1 / -1; }
}
