:root {
  color-scheme: dark;
  --bg: #121212;
  --text: rgb(212 212 216);
  --muted: rgb(161 161 170);
  --card: #1d1d1d;
  --border: #33302a;
  --page-width: 640px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

html {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #fff;
}

.site-header,
.site-main {
  width: min(100% - 32px, var(--page-width));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 8px;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
}

.nav-short {
  display: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.lang-btn:hover {
  border-color: var(--text);
  color: #fff;
}

html[data-variant="en"] .lang-btn[data-lang="en"],
html[data-variant="hans"] .lang-btn[data-lang="hans"],
html[data-variant="hant"] .lang-btn[data-lang="hant"] {
  border-color: var(--text);
  color: var(--text);
}

.site-main {
  padding: 28px 0 64px;
}

.page-title {
  margin: 0 0 18px;
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.app-list {
  display: grid;
}

.app-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 0;
}

.app-row + .app-row {
  border-top: 1px solid var(--border);
}

.app-row-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  color: inherit;
}

.app-row-main:hover {
  color: inherit;
}

.app-row-main:hover .app-summary {
  color: #fff;
}

.app-row:has(> a.app-row-main[href="#"]) {
  cursor: not-allowed;
}

a.app-row-main[href="#"] {
  cursor: not-allowed;
  pointer-events: none;
}

.app-external {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.app-external:hover {
  color: #fff;
}

.app-row .app-external::after {
  content: none;
}

.app-icon,
.about-icon {
  display: block;
  object-fit: cover;
  background: #fff;
}

.app-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.app-icon.has-light-border,
.about-icon.has-light-border {
  border: 1px solid var(--border);
}

.app-summary {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.about-icon {
  width: 64px;
  height: 64px;
  margin: 0 0 16px;
  border-radius: 16px;
}

img.app-icon[src*="katsu"],
img.about-icon[src*="katsu"] {
  overflow: hidden;
  border-radius: 32.5%;
}

.feature-list {
  margin: 0 0 1.1em;
  padding-left: 1.2em;
}

.feature-list li {
  margin: 0.15em 0;
}

.about-note {
  margin: 0 0 0.9em;
  color: var(--muted);
  font-size: 0.95rem;
}

.about-link {
  margin: 0;
}

.section-label {
  margin: 1.7em 0 0.75em;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.note-list {
  display: grid;
  gap: 12px;
}

.note-feed .note-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.note-feed .note-body *:not(table):not(thead):not(tbody):not(tr):not(th):not(td) {
  display: inline;
}

.note-feed .note-body > * + *::before {
  content: " ";
}

.note-card {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.note-app {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.note-app a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-body p {
  margin: 0 0 0.7em;
}

.note-body p:last-child {
  margin-bottom: 0;
}

.note-body :is(ul, ol) {
  margin: 0.25em 0 0.7em;
  padding-left: 1.2em;
}

.note-body :is(h2, h3) {
  margin: 0.85em 0 0.35em;
  font-size: 1rem;
  line-height: 1.3;
}

.note-body a,
.about-note a,
.about-link a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-card .note-body {
  font-size: 16px;
  line-height: 1.55;
}

.note-article .note-body {
  font-size: 18px;
  line-height: 1.65;
}

.note-date,
.note-article > .note-date {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.note-date:hover {
  color: #fff;
}

.note-article > .note-date {
  margin-top: 18px;
}

strong,
b {
  color: #fff;
  font-weight: 700;
}

a[target="_blank"]::after {
  content: "↗";
  margin-left: 0.12em;
  font-size: 0.72em;
  line-height: 1;
  vertical-align: super;
  text-decoration: none;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.contact-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 4px 4px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.contact-fab[hidden] {
  display: none;
}

.contact-fab-link {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
}

.contact-fab-link:hover {
  color: #fff;
}

.contact-fab-close {
  appearance: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.contact-fab-close:hover {
  color: #fff;
}

@media (max-width: 420px) {
  .site-header,
  .site-nav {
    gap: 10px;
  }

  .nav-full {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .nav-short {
    display: inline;
  }
}
