:root {
  --blue: #0820bf;
  --blue-dark: #061775;
  --ink: #17243b;
  --muted: #4b5d73;
  --line: #d5dfeb;
  --paper: #fff;
  --bg: #f3f6fb;
  --success: #155d39;
  --danger: #a21e2d;
  --radius: 18px;
}
* {
  box-sizing: border-box;
}
html {
  font-size: 16px;
  scroll-padding-top: 2rem;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    1rem/1.6 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button,
.button {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--blue);
  padding: 0.7rem 1.15rem;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}
button:hover,
.button:hover {
  background: var(--blue-dark);
  color: #fff;
}
.secondary {
  background: #fff;
  color: var(--blue);
}
.danger {
  background: #fff;
  border-color: var(--danger);
  color: var(--danger);
}
.danger:hover {
  background: var(--danger);
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--blue);
}
:focus-visible {
  outline: 3px solid #b05a00;
  outline-offset: 4px;
}
input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem;
  border: 1px solid #8093aa;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
textarea {
  resize: vertical;
  min-height: 120px;
}
input[type="file"] {
  padding: 0.6rem;
  max-width: 100%;
  overflow: hidden;
}
label,
legend {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
small,
.hint {
  font-size: 1rem;
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin-bottom: 0.8rem;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.35;
}
h3 {
  font-size: 1.12rem;
  line-height: 1.4;
}
p:last-child {
  margin-bottom: 0;
}
img {
  max-width: 100%;
  height: auto;
}
.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 20;
  background: #fff;
  padding: 1rem;
}
.skip:focus {
  top: 1rem;
}
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1200px;
  margin: auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 800;
  color: var(--blue);
  margin-right: auto;
}
.brand img {
  width: 130px;
  height: 48px;
  object-fit: contain;
}
.brand small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}
.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav a,
.nav button {
  font-size: 1rem;
  display: block;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
  border: 0;
  background: transparent;
}
.nav a:hover,
.nav button:hover {
  color: var(--blue);
  background: #edf1ff;
}
.nav a[aria-current="page"] {
  background: #e8edff;
  color: var(--blue);
}
.nav form {
  margin: 0;
}
.menu-toggle {
  display: none;
}
.badge {
  border-radius: 30px;
  display: inline-block;
  padding: 0.15rem 0.65rem;
  background: #e8edff;
  color: var(--blue);
  font-weight: 700;
  font-size: 1rem;
}
.page {
  max-width: 1040px;
  margin: auto;
  padding: 2rem 1.5rem 4rem;
  min-height: 70vh;
}
.narrow {
  max-width: 620px;
}
.page-head {
  margin-bottom: 1.8rem;
}
.eyebrow {
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  font-size: 1rem;
  margin-bottom: 0.65rem;
}
.panel,
.card,
.post,
.notice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.hero {
  padding: 2rem;
  background: linear-gradient(115deg, #fff, #edf1ff);
  border: 1px solid var(--line);
  border-radius: 24px;
  margin-bottom: 1.5rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  margin: 0;
  min-height: 160px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px #0820bf12;
}
.card strong {
  color: var(--blue);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.card span {
  color: var(--muted);
}
.card .card-action {
  color: var(--blue);
  font-weight: 700;
  margin-top: auto;
  padding-top: 1rem;
}
.stack > * + * {
  margin-top: 1rem;
}
.field {
  margin-bottom: 1.25rem;
}
.field .hint {
  display: block;
  margin: 0.35rem 0 0;
}
.field-error {
  display: block;
  color: var(--danger);
  min-height: 0;
}
.field-error:not(:empty) {
  margin-top: 0.35rem;
}
input[aria-invalid="true"] {
  border: 2px solid var(--danger);
}
.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.actions form {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}
.password-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.password-row input {
  min-width: 0;
  flex: 1;
}
.password-row button {
  flex: none;
}
.form-note {
  border-left: 4px solid var(--blue);
  background: #eef2ff;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.flash {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  border: 1px solid #8aba9e;
  background: #edf9f1;
  color: var(--success);
}
.flash.error {
  background: #fff1f2;
  color: #811727;
  border-color: #db9aa4;
}
.empty {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #fff;
  border: 1px dashed #9bacc2;
  border-radius: var(--radius);
}
.breadcrumbs {
  margin-bottom: 1.5rem;
}
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}
.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.4rem;
  color: var(--muted);
}
.subnav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.5rem;
}
.subnav a {
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  font-weight: 650;
  min-height: 48px;
}
.subnav a[aria-current="page"] {
  background: var(--blue);
  color: #fff;
}
.post {
  scroll-margin-top: 1rem;
}
.post-head {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1rem;
}
.avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.post-head p {
  margin: 0;
}
.post-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.post-image {
  max-height: 420px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  margin: 1rem 0;
}
.post-context {
  display: block;
  color: var(--muted);
  margin: 0.8rem 0;
  overflow-wrap: anywhere;
}
.post-actions {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.comments {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}
.comment {
  background: var(--bg);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}
.comment p {
  white-space: pre-wrap;
}
.comment-form {
  margin-top: 1rem;
}
details summary {
  cursor: pointer;
  min-height: 44px;
  padding: 0.5rem 0;
  color: var(--blue);
  font-weight: 700;
}
details[open] summary {
  margin-bottom: 0.8rem;
}
.account-list {
  display: grid;
  gap: 1rem;
}
.account-row {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.account-info {
  min-width: 0;
  overflow-wrap: anywhere;
}
.account-info h2,
.account-info p {
  margin-bottom: 0.35rem;
}
.account-info .actions {
  margin-top: 0.8rem;
}
.notification {
  display: block;
  color: var(--ink);
  text-decoration: none;
}
.notification.unread {
  border-left: 5px solid var(--blue);
  background: #eef2ff;
}
.notification strong {
  display: block;
}
.notification .hint {
  display: block;
  margin-top: 0.5rem;
}
.notification:hover {
  border-color: var(--blue);
}
.rank-list {
  list-style: none;
  padding: 0;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.7rem;
}
.rank-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue);
  min-width: 2.5rem;
}
.rank-row .count {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 700;
}
.cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 14px;
}
.profile-avatar {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border: 4px solid #fff;
  border-radius: 50%;
  margin-top: -48px;
  position: relative;
}
.image-preview {
  display: block;
  max-height: 180px;
  max-width: 100%;
  object-fit: contain;
  margin-top: 0.75rem;
}
.image-preview[hidden] {
  display: none;
}
.footer {
  max-width: 1040px;
  margin: auto;
  padding: 1.5rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.guide-list {
  padding-left: 1.4rem;
}
.guide-list li {
  padding-bottom: 0.5rem;
}
.page-search {
  display: flex;
  align-items: end;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-search .field {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.pagination {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  color: var(--ink);
}
dialog::backdrop {
  background: #10203b99;
}
dialog .actions {
  margin-top: 1.5rem;
}
.status-line {
  color: var(--muted);
}
.help-section {
  scroll-margin-top: 1rem;
}
.notification p {
  margin: 0;
}
.inline-form {
  display: inline;
}
.muted {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.rank-row > div {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.card,
.panel,
.hero,
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
@media (min-width: 900px) {
  .grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 850px) {
  .header-inner {
    padding: 0.75rem 1rem;
    gap: 0.6rem;
  }
  .brand small {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    padding-top: 0.5rem;
  }
  .js .nav:not(.is-open) {
    display: none;
  }
  .nav a,
  .nav button {
    width: 100%;
    text-align: left;
  }
  .nav form {
    width: 100%;
  }
  .page {
    padding: 1.5rem 1rem 3rem;
  }
  .hero {
    padding: 1.4rem;
  }
  .panel,
  .post,
  .notice {
    padding: 1.15rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .card {
    min-height: 140px;
    padding: 1.25rem;
  }
  .account-row {
    align-items: stretch;
    flex-direction: column;
  }
  .account-row .actions > * {
    flex: 1;
  }
  .cover {
    height: 150px;
  }
  .rank-row {
    gap: 0.6rem;
  }
  .rank-row a {
    min-width: 0;
  }
  .rank-row .count {
    font-size: 1rem;
  }
  .password-row {
    gap: 0.4rem;
  }
  .password-row button {
    padding: 0.65rem;
  }
  .actions > .button {
    flex-grow: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    transition: none !important;
  }
}
