/* --- ライト/ダークモード用の変数定義 --- */
:root {
  color-scheme: light dark;
  --bg-color: #f2f2f9;
  --text-color: #333;
  --text-color-subtle: #888;
  --card-bg-color: #fff;
  --border-color: #ccc;
  --header-bg-color: #007bff;
  --hover-bg-color: #e9ecef;
  --even-row-bg-color: #f8f9fa;
  --category-bg-color: #6c757d;
  --category-hover-bg-color: #5a626a;
  --link-color: #0366d6;
}
.dark-mode {
  color-scheme: dark;
  --bg-color: #202124;
  --text-color: #E8EAED;
  --text-color-subtle: #969ba1;
  --card-bg-color: #282828;
  --border-color: #3c4043;
  --hover-bg-color: #383838;
  --even-row-bg-color: #303030;
  --category-bg-color: #495057;
  --category-hover-bg-color: #5c636a;
  --link-color: #8ab4f8;
}

/* --- ここからが修正点です --- */
body {
  /* 
    1. まず'Noto Sans'を試す (ロシア語・英語用)
    2. なければ'Noto Sans JP'を試す (日本語用)
    3. それもなければ、デバイスの標準フォントを使う
  */
  font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
  margin: 0;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}
/* --- ここまで (言語ごとのサイズ・太さ補正はすべて削除) --- */

.content-wrapper { max-width: 1280px; margin: 0 auto; }
footer { text-align: center; margin-top: 40px; color: var(--text-color-subtle); font-size: 0.9em; }
footer p { margin: 5px 0; }
table a { color: var(--link-color); text-decoration: none; font-weight: 500; }
table a:hover { text-decoration: underline; }

/* --- ヘッダーとコントロールボタン --- */
.top-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}
#theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  padding: 8px;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s;
}
#theme-toggle .material-symbols-outlined { color: var(--text-color); }
#theme-toggle:hover { background-color: var(--hover-bg-color); }
.lang-switcher {
  display: flex;
  gap: 5px;
  background-color: var(--card-bg-color);
  padding: 5px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.lang-switcher button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: transparent;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: bold;
  color: var(--link-color);
  border-radius: 5px;
  transition: background-color 0.2s, color 0.2s;
}
.lang-switcher button:hover { background-color: var(--hover-bg-color); }
.lang-switcher button.active { background-color: var(--header-bg-color); color: white; }
.header { display: flex; align-items: center; margin-bottom: 20px; }
.header img { width: 50px; height: 50px; margin-right: 15px; border-radius: 50%; object-fit: cover; }
.header h1, .header h2 { margin: 0; }
.header h1 { font-size: 2em; }
.header h1 a { text-decoration: none; color: inherit; }
.header h2 { font-size: 1.2em; font-weight: normal; color: var(--text-color-subtle); }

/* --- モバイル用共通スタイル --- */
@media (max-width: 768px) {
    body { padding: 10px; }
    .header { flex-direction: column; align-items: center; margin-top: 50px; }
    .header img { margin-right: 0; margin-bottom: 10px; }
    .header div { text-align: center; }
    .header h1 { font-size: 1.8em; }
    .header h2 { font-size: 1.1em; }
    .top-controls { position: static; width: 100%; justify-content: flex-end; margin-bottom: 20px; order: -1; }
}