:root {
  --primary-color: #424242;
  --secondary-color: #616161;
  --accent-color: #757575;
  --light-bg: #f5f5f5;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --text-color: #333333;
  --text-light: #757575;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  /* 基本フォントサイズを大きくする */
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* タイポグラフィ */
h1, h2, h3, h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 {
  /* 見出しサイズも大きく */
  font-size: 2.5rem;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  position: relative;
  padding-left: 1rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2rem;
  height: 1.2rem;
  width: 4px;
  background: var(--accent-color);
  border-radius: 2px;
}

p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* ナビゲーション */
nav {
  margin: 1rem 0;
}

nav a {
  display: inline-block;
  padding: 10px 20px;
  margin: 0 5px 5px 0;
  font-size: 1.1rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: var(--transition);
}

nav a:hover {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  text-decoration: none;
}

/* カード・セクション */
section, .card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

/* フォーム要素 */
input, select, button, textarea {
  font-family: inherit;
  /* フォーム要素も大きく */
  font-size: 1.1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(117, 117, 117, 0.2);
}

input[type="submit"], button {
  background-color: var(--secondary-color);
  color: white;
  cursor: pointer;
  border: none;
  padding: 0.6rem 1.2rem;
}

input[type="submit"]:hover, button:hover {
  background-color: var(--primary-color);
}

/* テーブル */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  /* テーブル内も大きく */
  font-size: 1.05rem;
}

th {
  background-color: var(--light-bg);
  color: var(--primary-color);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: rgba(0,0,0,0.02);
}

/* テーブルヘッダー固定（横スクロール時も表示） */
.sticky-header thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

/* レスポンシブテーブル */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1rem;
}

/* コピーボタン */
.copy-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background-color: var(--primary-color);
}

/* グラフ */
canvas {
  max-width: 100%;
  height: auto;
  background-color: var(--card-bg);
  padding: 10px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

/* 数式表示 */
.formula {
  display: block;
  font-family: 'Consolas', 'Menlo', 'Monaco', monospace;
  background-color: var(--light-bg);
  padding: 1rem;
  margin: 1rem 0;
  border-left: 4px solid var(--accent-color);
  border-radius: var(--border-radius);
  overflow-x: auto;
  font-size: 1.1rem;
}

/* エラー表示 */
.out-of-range-blink {
  color: #e53935;
  font-weight: bold;
  display: inline-block;
  animation: blink 1s steps(2, start) infinite;
  margin-top: 4px;
  font-size: 1.1rem;
}

@keyframes blink {
  to { visibility: hidden; }
}

/* ★NEW★用アニメーション */
.new-badge {
  color: #e53935;
  font-weight: bold;
  animation: new-blink 1s steps(2, start) infinite;
}

@keyframes new-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  body {
    font-size: 16px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  section, .card {
    padding: 1rem;
  }
  
  th, td {
    padding: 0.7rem;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 8px;
  }

  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  section, .card {
    padding: 0.5rem;
    border-radius: 6px;
  }

  input, select, button, textarea {
    width: 100%;
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }

  nav a {
    display: block;
    margin-right: 0;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1rem;
    padding: 8px 16px;
  }

  form {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  form input[type="text"],
  form input[type="submit"] {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .mode-switch {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: flex-start !important;
    width: 100%;
  }
  .mode-switch label {
    display: block !important;
    width: 100%;
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  #temp-input,
  #pressure-input {
    width: 100%;
  }
  #temp-input label,
  #pressure-input label {
    display: block;
    text-align: left;
    margin-bottom: 0.2em;
  }
  #temp-input input,
  #pressure-input input,
  #pressure-input select {
    width: 100% !important;
    box-sizing: border-box;
  }

  input[type="checkbox"] {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 4px 0 0 !important;
    display: inline-block !important;
    vertical-align: middle;
  }
}
