:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --text: #2b2f33;
  --text-dim: #6b7278;
  --accent: #2f5d78;
  --border: #dde1e4;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.7;
  transition: background-color 1.2s ease, color 1.2s ease;
}

/* 旧システム残存率(legacy_level)に応じた段階的な暗色化。他の利用者には影響しない(セッション単位の表示) */
body[data-legacy-level="1"] {
  --bg: #eceeee;
  --surface: #fbfbfa;
  --border: #d4d8db;
}

body[data-legacy-level="2"] {
  --bg: #dee1e0;
  --surface: #f0f1ef;
  --text: #26292c;
  --border: #c2c7c8;
}

body[data-legacy-level="3"] {
  --bg: #c7cac6;
  --surface: #dddfda;
  --text: #1b1e20;
  --text-dim: #4f5457;
  --border: #a7aba8;
}

body[data-legacy-level="4"] {
  --bg: #4a4a44;
  --surface: #5a5952;
  --text: #eae8e0;
  --text-dim: #b6b3aa;
  --accent: #4d7d94;
  --border: #6e6c62;
}

body[data-legacy-level="5"] {
  --bg: #121210;
  --surface: #1c1b17;
  --text: #d6d3c8;
  --text-dim: #89867a;
  --accent: #588ba3;
  --border: #37352c;
}

/* レベル進行時の画面シェイク(進んだことを明示するための一度きりの演出) */
@keyframes legacy-shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3px, 2px); }
  20% { transform: translate(3px, -2px); }
  30% { transform: translate(-4px, 0); }
  40% { transform: translate(4px, 2px); }
  50% { transform: translate(-3px, -2px); }
  60% { transform: translate(3px, 2px); }
  70% { transform: translate(-2px, -1px); }
  80% { transform: translate(2px, 1px); }
  90% { transform: translate(-1px, 0); }
}

body.legacy-shake {
  animation: legacy-shake 0.65s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  body.legacy-shake {
    animation: none;
  }
}

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

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ヘッダー */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--accent);
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.site-logo {
  font-weight: bold;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
}

.nav-toggle__label {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle__label span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
}

.site-nav a:hover {
  color: var(--accent);
}

@media (max-width: 720px) {
  .nav-toggle__label {
    display: flex;
  }
  .site-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
  }
  .nav-toggle:checked ~ .site-nav {
    display: block;
  }
}

/* ヒーロー */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}

.hero h1 {
  margin-top: 0;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ボタン */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn:disabled {
  background: var(--border);
  color: var(--text-dim);
  cursor: not-allowed;
}

/* バッジ */
.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ececec;
  color: #6b7278;
}

.badge--ok {
  background: #e4edf2;
  color: #2f5d78;
}

.badge--muted {
  background: #ececec;
  color: #6b7278;
}

/* 検索フォーム */
.search-form {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.search-form input[type="text"],
.search-form select,
.inquiry-form input[type="text"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.search-form input[type="text"] {
  flex: 1;
  min-width: 200px;
}

/* 一覧・カード */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card,
.office-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
}

.item-card__name {
  font-weight: bold;
}

.item-card__meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 4px;
}

.office-card {
  display: block;
  margin-bottom: 12px;
}

.office-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

/* 詳細 */
.item-detail__meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  row-gap: 6px;
  margin: 16px 0;
}

.item-detail__meta dt {
  color: var(--text-dim);
}

.item-detail__meta dd {
  margin: 0;
}

/* お知らせ */
.notice-list {
  list-style: none;
  padding: 0;
}

.notice-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 14px;
}

.notice-list__date {
  color: var(--text-dim);
  min-width: 96px;
}

.notice-detail__date {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* 照会フォーム */
.inquiry-form {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.inquiry-result {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  /* レベルが進んでサイトが暗色化しても、この帳票風ボックスだけは常に明るい紙面として読めるようにする */
  color: #2b2f33;
}

.inquiry-result a {
  color: #2f5d78;
}

.inquiry-result .item-card {
  background: #ffffff;
  border-color: #dde1e4;
  color: #2b2f33;
}

.inquiry-result .item-card__meta {
  color: #6b7278;
}

.inquiry-result--notfound {
  background: #f7f2ea;
}

.inquiry-result--found {
  background: #eef4f7;
}

.inquiry-result--info {
  background: #f2f2f2;
}

.inquiry-result .item-card {
  margin-top: 12px;
}

.item-card--legacy {
  border-style: dashed;
}

/* フッター */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.site-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.site-footer__areas {
  list-style: none;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 0;
}

.site-footer__areas a {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.site-footer__notice {
  margin: 0 0 6px;
}

.site-footer__updated {
  margin: 0 0 6px;
}

.site-footer__copy {
  margin: 0;
}

/* 404 */
.notice-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

/* 旧システムの残骸(legacy_level進行に伴う演出) */
.legacy-shift h1,
.legacy-shift h2 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}

.legacy-shift {
  background: #eef0ef;
  border: 1px solid #aab3bb;
  color: #33393f;
  padding: 20px;
  border-radius: var(--radius);
}

.legacy-shift .legacy-code {
  font-weight: bold;
  letter-spacing: 0.05em;
}

.legacy-page section {
  margin-top: 20px;
}

/* ヒントウィジェット */
.hint-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  font-size: 0.85rem;
}

.hint-widget__toggle {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hint-widget__panel {
  margin-top: 8px;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.hint-widget__title {
  margin: 0 0 6px;
  font-weight: bold;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.hint-widget__body {
  margin: 0;
}
