@charset "UTF-8";

/* ========================================================
   2000年代 日本のテキストサイト・個人サイト風デザイン
   ======================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 10px 0;
  background-color: #dceaf7;
  /* レトロな微細ストライプ背景 */
  background-image: repeating-linear-gradient(
    0deg,
    #dceaf7,
    #dceaf7 2px,
    #e8f2fc 2px,
    #e8f2fc 4px
  );
  color: #111111;
  font-family: "MS PGothic", "ＭＳ Ｐゴシック", "MS Gothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

/* 昔ながらの青リンク・赤ホバー */
a {
  color: #0000cc;
  text-decoration: underline;
  cursor: pointer;
}

a:visited {
  color: #551a8b;
}

a:hover, a:active {
  color: #ff0000;
  text-decoration: underline;
}

/* サイト全体コンテナ (PC 960px 中央寄せ) */
.site-container {
  max-width: 960px;
  margin: 0 auto;
  background-color: #ffffff;
  border: 2px solid #5a7b9c;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.25);
  padding: 12px 16px 20px 16px;
}

/* --------------------------------------------------------
   ヘッダーエリア
   -------------------------------------------------------- */
.site-header {
  border-bottom: 2px groove #a0b8d0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.header-banner {
  text-align: center;
  padding: 10px 0 6px 0;
  background: linear-gradient(180deg, #e3effc 0%, #b8d4f4 100%);
  border: 1px solid #759bc4;
  margin-bottom: 8px;
}

.site-title {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  color: #003366;
  text-shadow: 1px 1px 0 #ffffff;
  letter-spacing: 1px;
}

.site-subtitle {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #335577;
}

.header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 6px;
  background-color: #f2f7fc;
  border: 1px solid #c8d8e8;
  font-size: 12px;
}

/* 黒背景に蛍光緑のアクセスカウンター */
.counter-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.counter-label {
  font-weight: bold;
  color: #333333;
}

.counter-display {
  background-color: #000000;
  color: #00ff00;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 1px 6px;
  border: 2px inset #555555;
  box-shadow: inset 1px 1px 2px #000000;
}

.counter-unit {
  font-weight: bold;
  color: #cc0000;
}

.last-update {
  color: #444444;
}

/* 流れるテロップ（マーキー） */
.marquee-container {
  margin-top: 8px;
  background-color: #ffffcc;
  border: 1px solid #ddcc77;
  padding: 3px 6px;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-anim 28s linear infinite;
  color: #880000;
  font-weight: bold;
  font-size: 12px;
}

@keyframes marquee-anim {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-100%, 0);
  }
}

/* --------------------------------------------------------
   共通セクション見出しバー
   -------------------------------------------------------- */
.section-title-bar {
  background: linear-gradient(90deg, #104e8b 0%, #3a75b0 60%, #bed4ec 100%);
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
  padding: 4px 8px;
  border-left: 6px solid #ff9900;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title-bar .bullet {
  color: #ffcc00;
  font-size: 12px;
}

/* --------------------------------------------------------
   検索条件エリア
   -------------------------------------------------------- */
.search-section {
  margin-bottom: 14px;
  border: 1px solid #99b6d8;
  background-color: #f7fafd;
  padding: 8px;
}

.search-form-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.search-form-table th,
.search-form-table td {
  padding: 6px 8px;
  border: 1px solid #b8cde4;
}

.search-form-table th {
  background-color: #dbe8f7;
  color: #003366;
  text-align: right;
  width: 15%;
  white-space: nowrap;
  font-weight: bold;
}

.search-form-table td {
  background-color: #ffffff;
  width: 35%;
}

.form-select,
.form-input {
  width: 100%;
  padding: 3px 5px;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid #7f9db9;
  background-color: #ffffff;
}

.form-input:focus,
.form-select:focus {
  outline: 1px solid #ff9900;
  background-color: #fffff0;
}

/* 立体的なレトロボタン (outset / inset) */
.search-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 18px;
  cursor: pointer;
  background-color: #ece9d8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #707070;
  border-bottom: 2px solid #707070;
  box-shadow: 1px 1px 0 #000000;
}

.btn:active {
  border-top: 2px solid #707070;
  border-left: 2px solid #707070;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 5px 17px 3px 19px;
}

.btn-primary {
  background: linear-gradient(180deg, #f7f3e8 0%, #dcd7c5 100%);
  color: #002244;
}

.btn-secondary {
  background: linear-gradient(180deg, #f0f0f0 0%, #dcdcdc 100%);
  color: #333333;
}

.btn-copy {
  font-size: 11px;
  padding: 3px 8px;
  background: linear-gradient(180deg, #fff2db 0%, #f7d29c 100%);
  color: #7a3500;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #8f6535;
  border-bottom: 2px solid #8f6535;
  white-space: nowrap;
}

.btn-copy:active {
  border-top: 2px solid #8f6535;
  border-left: 2px solid #8f6535;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  padding: 4px 7px 2px 9px;
}

/* お気に入り登録・解除ボタン (2000年代風立体ボタン) */
.btn-fav {
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 100%);
  color: #444444;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

.btn-fav:hover {
  background: #f4f4f4;
}

.btn-fav:active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 4px 7px 2px 9px;
}

/* お気に入り登録済み状態（黄色・凹み） */
.btn-fav.active {
  background: linear-gradient(180deg, #fffde6 0%, #fae675 100%);
  color: #774400;
  border-top: 2px solid #996600;
  border-left: 2px solid #996600;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  box-shadow: inset 1px 1px 2px rgba(100, 50, 0, 0.25);
}

.btn-fav .fav-star {
  color: #ff9900;
  margin-right: 2px;
  font-size: 12px;
}

.btn-fav.active .fav-star {
  color: #d86e00;
  text-shadow: 0 0 2px #fff;
}

/* --------------------------------------------------------
   検索結果ステータスバー
   -------------------------------------------------------- */
.result-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px 8px;
  background-color: #e4eef9;
  border: 1px solid #abc5e2;
  margin-bottom: 8px;
  font-size: 12px;
}

.status-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* お気に入りのみ表示フィルター用ラベル */
.fav-filter-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.fav-checkbox {
  margin: 0;
  cursor: pointer;
}

.fav-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: bold;
  background-color: #ffffff;
  border: 1px solid #a0b8d0;
  color: #335577;
  border-radius: 2px;
}

.fav-filter-container:hover .fav-filter-btn {
  background-color: #fffde0;
  border-color: #cca030;
}

.fav-checkbox:checked + .fav-filter-btn {
  background: linear-gradient(180deg, #fff2ad 0%, #ffd043 100%);
  border: 1px solid #a87200;
  color: #663300;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.fav-filter-btn .star-icon {
  color: #ff9900;
  font-size: 12px;
}

.result-status-bar strong {
  color: #cc0000;
  font-size: 13px;
}

.guide-note {
  color: #555555;
  font-size: 11px;
}

/* --------------------------------------------------------
   一覧テーブルエリア (PC 960px)
   -------------------------------------------------------- */
.table-section {
  margin-bottom: 14px;
  overflow-x: auto;
}

.subsidy-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #3b6b98;
  background-color: #ffffff;
  font-size: 12px;
}

.subsidy-table thead tr {
  background: linear-gradient(180deg, #376f9f 0%, #204b73 100%);
  color: #ffffff;
}

.subsidy-table th {
  padding: 6px 6px;
  border: 1px solid #5a8ab5;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
}

.subsidy-table td {
  padding: 6px 8px;
  border: 1px solid #c2d6e9;
  vertical-align: middle;
}

.subsidy-table tbody tr:nth-child(even) {
  background-color: #f5f9fd;
}

.subsidy-table tbody tr:hover {
  background-color: #fffde6;
}

/* 列幅調整 */
.col-badge { width: 75px; text-align: center; }
.col-title { min-width: 220px; }
.col-amount { width: 125px; text-align: right; font-weight: bold; color: #a00000; white-space: nowrap; }
.col-area { width: 75px; text-align: center; white-space: nowrap; }
.col-period { width: 165px; text-align: center; font-size: 11px; white-space: nowrap; }
.col-fav { width: 90px; text-align: center; white-space: nowrap; }
.col-action { width: 95px; text-align: center; }

/* 補助金名リンク風ボタン */
.subsidy-name-link {
  font-weight: bold;
  color: #0033cc;
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
  line-height: 1.35;
}

.subsidy-name-link:hover {
  color: #ff0000;
}

.category-tag {
  display: inline-block;
  font-size: 10px;
  background-color: #e2edfa;
  color: #194e80;
  border: 1px solid #abc7e6;
  padding: 0 4px;
  margin-right: 4px;
  border-radius: 2px;
}

.scale-note {
  font-size: 10px;
  color: #666666;
  margin-top: 2px;
}

/* 点滅アニメーション（blink）赤文字バッジ */
.badge-blink {
  display: inline-block;
  font-weight: bold;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 2px;
  animation: retro-blink 1s steps(2, start) infinite;
}

.badge-new {
  color: #ffffff;
  background-color: #ee0000;
  border: 1px solid #990000;
  text-shadow: 1px 1px 0 #550000;
}

.badge-urgent {
  color: #ffffff;
  background-color: #ff6600;
  border: 1px solid #bb4400;
  text-shadow: 1px 1px 0 #662200;
}

.badge-normal {
  color: #444444;
  font-size: 11px;
}

@keyframes retro-blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}

/* データ0件時の表示 */
.no-data-cell {
  text-align: center;
  padding: 30px 10px;
  color: #880000;
  font-weight: bold;
  background-color: #fff9f9;
}

/* 2000年代風ローディング表示 */
.loading-cell {
  text-align: center;
  padding: 36px 12px;
  background-color: #f7fbff;
}

.loading-box {
  display: inline-block;
  border: 2px inset #99b0c8;
  background-color: #ffffff;
  padding: 12px 24px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
  display: inline-block;
  color: #004488;
  font-size: 16px;
  margin-right: 6px;
  animation: retro-blink 0.8s steps(2, start) infinite;
}

.loading-text {
  font-size: 13px;
  font-weight: bold;
  color: #003366;
  letter-spacing: 0.5px;
}

.loading-sub {
  display: block;
  font-size: 11px;
  color: #666666;
  margin-top: 4px;
  font-family: monospace;
}

/* 2000年代風エラー表示 */
.error-cell {
  text-align: center;
  padding: 24px 14px;
  background-color: #fff4f4;
}

.error-box {
  display: inline-block;
  max-width: 600px;
  text-align: left;
  border: 2px solid #cc0000;
  background-color: #ffffff;
  padding: 12px 16px;
  color: #333333;
  line-height: 1.6;
}

.error-title {
  color: #cc0000;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
  border-bottom: 1px dotted #cc0000;
  padding-bottom: 3px;
}

.error-detail {
  display: block;
  font-size: 11px;
  color: #666666;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  padding: 4px 6px;
  margin-top: 6px;
  word-break: break-all;
}

.error-actions {
  margin-top: 10px;
  text-align: center;
}

/* --------------------------------------------------------
   所員向けワンポイントメモ
   -------------------------------------------------------- */
.tips-section {
  margin-bottom: 12px;
  border: 1px dotted #8faecf;
  background-color: #fafff8;
  padding: 8px 10px;
}

.tips-list {
  margin: 6px 0 0 16px;
  padding: 0;
  font-size: 12px;
}

.tips-list li {
  margin-bottom: 4px;
  color: #333333;
}

/* --------------------------------------------------------
   フッター
   -------------------------------------------------------- */
.site-footer {
  border-top: 2px groove #a0b8d0;
  padding-top: 10px;
  text-align: center;
  font-size: 11px;
  color: #555555;
}

.footer-links {
  margin-bottom: 6px;
}

.footer-links a {
  margin: 0 4px;
}

.copyright {
  margin: 4px 0;
}

.badge-row {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.retro-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-family: monospace;
  background-color: #2b4967;
  color: #ffffff;
  border: 1px outset #888888;
}

/* --------------------------------------------------------
   トースト通知 (画面右下・Windowsバルーン風)
   -------------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 290px;
  background-color: #ffffdd;
  border: 2px solid #555555;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  z-index: 9999;
  font-family: inherit;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.toast-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast-title {
  font-weight: bold;
  color: #003399;
  font-size: 12px;
  margin-bottom: 3px;
  border-bottom: 1px dotted #888888;
  padding-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: #111111;
  line-height: 1.4;
}

/* ========================================================
   レスポンシブ対応 (スマホ: 768px以下)
   - 検索フォーム縦積み
   - テーブルをカード形式 (data-label 活用) へ自動変形
   ======================================================== */
@media screen and (max-width: 768px) {
  body {
    padding: 0;
  }

  .site-container {
    width: 100%;
    border-left: none;
    border-right: none;
    box-shadow: none;
    padding: 8px 8px 16px 8px;
  }

  .site-title {
    font-size: 16px;
  }

  .header-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  /* 検索フォームの縦積み変形 */
  .search-form-table,
  .search-form-table tbody,
  .search-form-table tr,
  .search-form-table th,
  .search-form-table td {
    display: block;
    width: 100% !important;
  }

  .search-form-table th {
    text-align: left;
    background-color: #e7eff8;
    border-bottom: none;
    padding: 4px 6px;
  }

  .search-form-table td {
    border-top: none;
    padding: 4px 6px 8px 6px;
  }

  .search-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .search-buttons .btn {
    width: 100%;
    padding: 8px 0;
  }

  /* テーブルのカード変形レイアウト */
  .subsidy-table {
    border: none;
    background-color: transparent;
  }

  .subsidy-table thead {
    display: none; /* スマホではヘッダー行を非表示 */
  }

  .subsidy-table tbody {
    display: block;
  }

  .subsidy-table tr {
    display: block;
    background-color: #ffffff;
    border: 2px solid #5a7b9c;
    margin-bottom: 14px;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.15);
    padding: 6px;
  }

  .subsidy-table td {
    display: block;
    width: 100% !important;
    text-align: left !important;
    position: relative;
    padding: 6px 6px 6px 110px;
    border: none;
    border-bottom: 1px dotted #c5d6e6;
    min-height: 32px;
  }

  .subsidy-table td:last-child {
    border-bottom: none;
    padding-top: 8px;
    text-align: center !important;
    padding-left: 6px;
  }

  /* data-label 属性による項目名表示 */
  .subsidy-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    top: 6px;
    width: 95px;
    font-weight: bold;
    color: #204b73;
    font-size: 11px;
    background-color: #edf4fa;
    padding: 2px 4px;
    border: 1px solid #c8d8e8;
    text-align: center;
  }

  .subsidy-table td[data-label="お気に入り"] .btn-fav {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
  }

  /* 最後の案内ボタンセルは全幅ボタン */
  .subsidy-table td:last-child::before {
    display: none;
  }

  .subsidy-table td:last-child .btn-copy {
    width: 100%;
    padding: 8px 0;
    font-size: 13px;
  }

  .toast-notification {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 12px;
  }
}
