/* === PC・共通スタイル === */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  margin: 40px;
  background: #fafafa;
  color: #222;
}

h1 {
  font-size: 1.8em;
  margin-bottom: 0.5em;
}

p {
  color: #555;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

th, td {
  border-bottom: 1px solid #eee;
  padding: 10px;
  text-align: left;
}

th {
  background: #f3f3f3;
  font-weight: bold;
}

a {
  color: #0073e6;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

input#search {
  margin: 15px 0;
  padding: 8px 10px;
  width: 300px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

canvas {
  display: block;
  margin: 30px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* === 絞り込みフォーム === */
#year-filter,
#month-filter {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  margin: 10px 5px 10px 0;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#year-filter:focus,
#month-filter:focus {
  border-color: #0073e6;
  box-shadow: 0 0 3px rgba(0, 115, 230, 0.4);
  outline: none;
}

/* === リセットボタン === */
#reset-filter {
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: linear-gradient(to bottom, #fafafa, #f0f0f0);
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#reset-filter:hover {
  background: linear-gradient(to bottom, #fefefe, #e8e8e8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

#reset-filter:active {
  background: #e0e0e0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

#reset-filter:focus {
  outline: none;
  border-color: #0073e6;
  box-shadow: 0 0 3px rgba(0, 115, 230, 0.4);
}

/* === 絞り込みフォーム全体の配置調整 === */
#filter-container {
  margin-top: 20px;
  margin-bottom: 10px;
}

/* ======================================================
   スマートフォン対応（〜768px）
   ====================================================== */
@media screen and (max-width: 768px) {

  body {
    margin: 20px;
    font-size: 15px;
    background: #fafafa;
  }

  h1 {
    font-size: 1.4em;
    text-align: center;
    margin-bottom: 1em;
  }

  p {
    line-height: 1.6;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  th, td {
    padding: 8px;
    font-size: 14px;
  }

  th {
    white-space: nowrap;
  }

  input#search {
    width: 100%;
    max-width: 100%;
    font-size: 15px;
    padding: 10px;
    box-sizing: border-box;
  }

  #filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-top: 15px;
  }

  #year-filter,
  #month-filter {
    flex: 1 1 48%;
    font-size: 15px;
    padding: 10px;
  }

  #reset-filter {
    flex: 1 1 100%;
    margin-top: 5px;
    font-size: 15px;
    padding: 10px;
  }

/*
  .chart-container {
    width: 100%;
    overflow-x: auto;
  }

  .chart-container canvas {
    min-width: 600px;
  }

  canvas {
    width: 100% !important;
    max-width: 100%;
    margin: 20px 0;
  }
*/

  .chart-container {
    width: 100%;
    overflow-x: auto;
  }

  .chart-container canvas {
    min-width: 600px;
    height: 300px !important;
  }

  a {
    white-space: nowrap;
  }
}

/* ======================================================
   iPhone・小画面専用（〜480px）
   ====================================================== */
@media screen and (max-width: 480px) {

  body {
    margin: 15px;
    font-size: 14px;
  }

  h1 {
    font-size: 1.2em;
    margin-bottom: 0.8em;
  }

  input#search {
    font-size: 14px;
    padding: 9px;
  }

  #filter-container {
    flex-direction: column;
    gap: 10px;
  }

  #year-filter,
  #month-filter {
    width: 100%;
    font-size: 14px;
  }

  #reset-filter {
    width: 100%;
    font-size: 14px;
    padding: 9px;
  }

  th, td {
    padding: 6px;
    font-size: 13px;
  }

  table {
    font-size: 13px;
  }

/*
  canvas {
    margin: 15px 0;
  }
*/

  .chart-container canvas {
    height: 260px !important;
  }
}