*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 320px;
  background: var(--glow);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(32px + env(safe-area-inset-top)) 16px 18px;
  text-align: center;
}

.site-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-1);
}

.site-hint {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.browser-frame {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-2);
}

.browser-globe {
  flex: none;
  color: var(--text-2);
}

.browser-address {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.browser-lock {
  flex: none;
  color: var(--text-3);
}

.browser-search {
  flex: none;
  margin-left: auto;
  color: var(--text-3);
}

.browser-host {
  margin: 0;
  min-width: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-caret {
  flex: none;
  width: 2px;
  height: 20px;
  border-radius: 1px;
  background: var(--brand);
  animation: caret-blink 1.1s steps(1, end) infinite;
}

.browser-host.is-typing + .browser-caret {
  animation: none;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .browser-caret {
    animation: none;
  }
}

.site-slogan {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.site-divider {
  width: 54px;
  height: 2px;
  margin-top: 18px;
  border-radius: var(--radius-pill);
  background: var(--brand);
}



.notice {
  display: none;
  margin: 0 16px 12px;
  padding: 8px 12px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
}

.notice.is-visible {
  display: block;
}

.app-shell.no-tabbar {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px;
}

.project-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 60px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-2);
}

.project-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
}

.project-icon img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.project-main {
  flex: 1;
  min-width: 0;
}

.project-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-desc {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-3);
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
}

.badge {
  flex: none;
  padding: 1px 6px;
  font-size: 0.625rem;
  line-height: 1.6;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-new {
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
}

.badge-maintenance {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid transparent;
}

.badge-stopped {
  color: var(--text-3);
  background: var(--bg-hover);
  border: 1px solid transparent;
}

.project-card.is-stopped {
  opacity: 0.55;
}

.project-card.is-stopped .project-icon {
  filter: grayscale(1);
}

.section {
  margin-top: 22px;
  padding: 0 12px;
  scroll-margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px 8px;
}

.section-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.section-more {
  font-size: 0.75rem;
  color: var(--text-3);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.contact-item:active {
  transform: scale(0.985);
  border-color: var(--brand-line);
}

.contact-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
}

.contact-label {
  flex: none;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.contact-value {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.contact-action {
  flex: none;
  padding: 4px 10px;
  font-size: 0.6875rem;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-pill);
}

.site-footer {
  padding: 24px 16px 8px;
  text-align: center;
  font-size: 0.6875rem;
  line-height: 1.9;
  color: var(--text-3);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: calc(52px + env(safe-area-inset-bottom));
  padding: 4px 10px calc(4px + env(safe-area-inset-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  gap: 2px;
  max-width: 76px;
  height: 44px;
  border-radius: 10px;
  font-size: 0.625rem;
  color: var(--text-3);
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.tab-item svg {
  width: 18px;
  height: 18px;
  transition: transform 0.18s ease;
}

.tab-item.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}

.tab-item.is-active svg {
  transform: translateY(-1px) scale(1.06);
}

.tab-item:active {
  transform: scale(0.96);
}

.skeleton-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 60px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}

.skeleton-card::after {
  content: "";
  flex: none;
  width: 30px;
  height: 30px;
  background: var(--bg-hover);
  border-radius: var(--radius-pill);
}

.sk {
  background-image: linear-gradient(90deg, var(--bg-hover) 0%, var(--bg-soft) 50%, var(--bg-hover) 100%);
  background-size: 240px 100%;
  border-radius: 6px;
  animation: sk-move 1.2s linear infinite;
}

.sk-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.sk-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sk-line-lg {
  width: 42%;
  height: 12px;
}

.sk-line-sm {
  width: 72%;
  height: 10px;
}

.empty {
  padding: 36px 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-3);
  background: var(--bg-card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 60;
  padding: 8px 14px;
  font-size: 0.8125rem;
  color: #fff;
  background: rgba(20, 22, 28, 0.88);
  border-radius: var(--radius-pill);
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes sk-move {
  from {
    background-position: -120px 0;
  }
  to {
    background-position: 240px 0;
  }
}

@media (min-width: 768px) {
  body {
    background: var(--bg-soft);
  }

  body::before {
    display: none;
  }

  .app-shell {
    max-width: 420px;
    margin: 0 auto;
    background-color: var(--bg);
    background-image: var(--glow);
    background-repeat: no-repeat;
    background-size: 100% 320px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-2);
  }

  .tabbar {
    right: auto;
    left: 50%;
    width: 420px;
    transform: translateX(-50%);
  }
}

.page-view {
  padding-top: 4px;
}

.page-view .article-card {
  margin-left: 12px;
  margin-right: 12px;
}

.page-view .empty {
  margin: 0 12px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 12px;
  padding: 40px 20px 36px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.empty-state-icon {
  margin-bottom: 14px;
  color: var(--text-3);
}

.empty-state-title {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.empty-state-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-3);
}

.about-card {
  margin: 0 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.about-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--text-2);
}

.about-text + .about-text {
  margin-top: 10px;
}

.article-card {
  display: block;
  margin-bottom: 8px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.article-card:active {
  transform: scale(0.99);
  border-color: var(--brand-line);
}

.article-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
}

.article-card-summary {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.6875rem;
  color: var(--text-3);
}

.tag {
  padding: 1px 7px;
  font-size: 0.625rem;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-pill);
}

.article-detail {
  margin: 0 12px;
  padding: 18px 16px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.article-detail-title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.45;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
  padding-bottom: 14px;
  font-size: 0.6875rem;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
}

.article-body {
  font-size: 0.875rem;
  line-height: 1.95;
  color: var(--text);
  word-break: break-word;
}

.article-body h2 {
  margin: 22px 0 10px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.article-body h3 {
  margin: 18px 0 8px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.article-body p {
  margin: 0 0 14px;
  color: var(--text-2);
}

.article-body ul,
.article-body ol {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--text-2);
}

.article-body li {
  margin-bottom: 6px;
}

.article-body code {
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  background: var(--bg-hover);
  border-radius: 5px;
}

.article-body pre {
  margin: 0 0 14px;
  padding: 12px;
  overflow-x: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.article-body pre code {
  padding: 0;
  background: none;
}

.article-body blockquote {
  margin: 0 0 14px;
  padding: 8px 12px;
  color: var(--text-2);
  background: var(--bg-soft);
  border-left: 3px solid var(--brand-line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sk {
    animation: none;
  }

  .project-card,
  .contact-item,
  .article-card,
  .toast {
    transition: none;
  }
}
