/* 色 */
:root {
  --header-bg: rgb(229, 239, 242);
  --text: #222;
  --link: #1a5f8a;
  --line: #ccc;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  background: #fff;
}

a { color: var(--link); }

/* ロゴ */
.logo {
  display: block;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.logo-sub { display: block; font-size: 13px; }
.logo-main { display: block; font-size: 24px; }

/* 左メニュー（PC） */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--header-bg);
  border-right: 2px solid #000;
  overflow-y: auto;
}
.logo-side {
  padding: 20px 16px;
  border-bottom: 1px solid #000;
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li a {
  display: block;
  padding: 12px 16px;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #b9cdd3;
}
.sidebar li a:hover { background: rgb(248, 253, 254); }
.sidebar li a.current {
  background: #fff;
  font-weight: bold;
}

.topbar, .nav-toggle { display: none; }

/* 本文 */
.main {
  margin-left: var(--sidebar-w);
  padding: 30px 40px 40px;
  max-width: calc(var(--sidebar-w) + 860px);
}

h1 {
  font-size: 24px;
  font-weight: normal;
  margin: 40px 0 12px;
  padding: 2px 10px;
  border-left: 8px solid lightblue;
  background: #e3f2fd;
}
.main > h1:first-child { margin-top: 0; }

h2 {
  font-size: 17px;
  font-weight: bold;
  margin: 28px 0 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgb(255, 190, 200);
}

p { margin: 0 0 1em; }

ul { padding-left: 1.4em; }

/* 表 */
table {
  border-collapse: collapse;
  width: 100%;
  max-width: 640px;
  margin-bottom: 8px;
}
th, td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
th {
  width: 7em;
  background: #f5f7f8;
  font-weight: normal;
  white-space: nowrap;
}

/* 数研ノート */
.article-filter { margin: 20px 0 8px; }
.article-filter input {
  width: 100%;
  max-width: 420px;
  padding: 6px 10px;
  font: inherit;
  font-size: 15px;
  border: 1px solid #999;
}
.tag-list { margin-top: 10px; }
.tag {
  margin: 0 6px 6px 0;
  padding: 2px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid #999;
  cursor: pointer;
}
.tag:hover { background: var(--header-bg); }
.tag.selected { background: lightblue; border-color: #6aa9bd; }
.tag.small { font-size: 12px; padding: 0 6px; margin: 4px 4px 0 0; }
.article-count { font-size: 14px; color: #666; margin-bottom: 6px; }

.articles { padding-left: 1.4em; }
.articles li { margin-bottom: 14px; }
.articles .meta { font-size: 14px; color: #666; margin-left: 6px; }
.articles .download { font-size: 13px; margin-left: 10px; }
.articles .summary { font-size: 14px; color: #444; }

/* フッター */
.footer {
  margin-left: var(--sidebar-w);
  padding: 16px 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: #666;
}

/* スマホ */
@media (max-width: 800px) {
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 20;
    height: 60px;
    padding: 0 12px;
    background: var(--header-bg);
    border-bottom: 1.5px solid #000;
  }
  .topbar .logo-main { font-size: 20px; }
  .topbar .logo-sub { font-size: 12px; }

  .nav-button {
    position: relative;
    width: 44px;
    height: 44px;
    cursor: pointer;
  }
  .nav-button span,
  .nav-button span::before,
  .nav-button span::after {
    content: "";
    position: absolute;
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: #000;
  }
  .nav-button span { top: 21px; left: 10px; }
  .nav-button span::before { top: -8px; }
  .nav-button span::after { top: 8px; }
  .nav-toggle:checked ~ .topbar .nav-button span { background: transparent; }
  .nav-toggle:checked ~ .topbar .nav-button span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle:checked ~ .topbar .nav-button span::after { top: 0; transform: rotate(-45deg); }

  .sidebar {
    top: 60px;
    width: 100%;
    border-right: none;
    display: none;
    z-index: 15;
  }
  .logo-side { display: none; }
  .nav-toggle:checked ~ .sidebar { display: block; }

  .main { margin-left: 0; padding: 20px 16px 30px; }
  .footer { margin-left: 0; padding: 14px 16px; }
  h1 { font-size: 21px; }
}
