:root {
  --background: #f5f5f3;
  --surface: #ffffff;
  --text: #222220;
  --muted: #777772;
  --line: #e5e5e1;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--background);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--background);
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.shell {
  width: min(100% - 32px, 480px);
  margin-inline: auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: var(--text);
  color: white;
  font-size: 13px;
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.language-switch:hover { border-color: #ccccca; }
.language-switch:active { transform: scale(0.97); }
.language-switch__active { color: var(--text); font-weight: 650; }

.language-switch__divider {
  width: 1px;
  height: 11px;
  background: var(--line);
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  gap: 13px;
  align-items: center;
  min-height: 88px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.link-card:hover,
.link-card:focus-visible {
  border-color: #c9c9c5;
  outline: none;
  transform: translateY(-1px);
}

.link-card__monogram {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--background);
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.link-card__icon-image,
.link-card__icon-fallback {
  grid-area: 1 / 1;
}

.link-card__icon-image {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0;
}

.link-card__monogram.has-icon .link-card__icon-image { opacity: 1; }
.link-card__monogram.has-icon .link-card__icon-fallback { visibility: hidden; }

.link-card__body { min-width: 0; }

.link-card__name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
}

.link-card__description,
.link-card__url {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card__url { display: none; }

.link-card__arrow {
  color: #999994;
  font-family: sans-serif;
  font-size: 15px;
  text-align: center;
}

.bookmark-note {
  margin-top: 22px;
  color: var(--muted);
  text-align: center;
}

.bookmark-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 28px;
  color: #999994;
  font-size: 11px;
  text-align: center;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

noscript {
  display: block;
  padding: 20px;
  text-align: center;
}

@media (max-width: 420px) {
  .shell { width: min(100% - 24px, 480px); }
  .link-card { padding-inline: 14px; }
}
