:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #68736f;
  --line: #dbe3df;
  --teal: #008b84;
  --teal-strong: #006e68;
  --teal-soft: #e6f5f3;
  --amber: #b97515;
  --amber-soft: #fff2dc;
  --nav: #101a1d;
  --nav-soft: #1b292d;
  --shadow: 0 20px 45px rgba(18, 32, 36, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: #eef7f5;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #14b8ad, #05756f);
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.2;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #9fb2af;
  font-size: 0.78rem;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-title {
  margin: 0 0 8px;
  color: #9fb2af;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-item {
  width: 100%;
  border: 0;
  color: #dbe7e4;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.nav-item strong {
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dffaf7;
  text-align: center;
  font-size: 0.78rem;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--nav-soft);
}

.nav-item.is-active strong {
  background: var(--teal);
  color: #fff;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.sidebar-note p {
  color: #b5c5c2;
  line-height: 1.7;
  font-size: 0.84rem;
  margin: 0;
}

.workspace {
  padding: 34px clamp(22px, 4vw, 54px) 48px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0 0 8px;
  color: var(--teal);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.03;
  letter-spacing: 0;
}

.lead {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
  max-width: 760px;
}

.status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  min-width: 150px;
  box-shadow: var(--shadow);
}

.status-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.status-card strong {
  font-size: 0.96rem;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 210px;
  gap: 16px;
  margin: 24px 0;
}

.search-box,
.select-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.search-box span,
.select-box span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

input,
select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(440px, 0.95fr) minmax(420px, 1.05fr);
  gap: 22px;
  align-items: start;
}

.article-list,
.reader {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.list-head,
.article-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 100px;
  gap: 14px;
  align-items: center;
}

.list-head {
  padding: 16px 18px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}

.article-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}

.article-row:last-child {
  border-bottom: 0;
}

.article-row:hover,
.article-row.is-selected {
  background: var(--teal-soft);
}

.article-title {
  display: block;
  font-weight: 800;
  line-height: 1.45;
}

.article-desc {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 6px;
  padding: 6px 9px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 800;
  font-size: 0.78rem;
}

.date {
  color: var(--muted);
  font-size: 0.84rem;
}

.reader {
  padding: clamp(24px, 3vw, 38px);
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.reader h2 {
  margin: 0 0 12px;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.reader-summary {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
  margin-bottom: 28px;
}

.article-body {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  line-height: 1.28;
  letter-spacing: 0;
}

.article-body h1 {
  font-size: 2rem;
}

.article-body h2 {
  margin-top: 34px;
  font-size: 1.45rem;
}

.article-body h3 {
  margin-top: 26px;
  font-size: 1.12rem;
}

.article-body p,
.article-body li {
  color: #303b38;
  line-height: 1.9;
}

.article-body a {
  color: var(--teal-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  font-size: 0.9rem;
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}

.article-body th {
  background: #f2f6f4;
  text-align: left;
}

.article-body pre {
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: #101a1d;
  color: #e9f5f2;
}

.article-body code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.article-body :not(pre) > code {
  background: #eef4f2;
  padding: 0.16em 0.38em;
  border-radius: 5px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 10px 0 18px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .reader {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 24px 16px 36px;
  }

  .topbar,
  .controls {
    grid-template-columns: 1fr;
    display: grid;
  }

  .list-head {
    display: none;
  }

  .article-row {
    grid-template-columns: 1fr;
  }
}
