/* ==========================================================================
 * 共通設定
 * ========================================================================== */
/* 1. 画面全体 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==========================================================================
 * スクロールバー共通デザイン
 * ========================================================================== */
/* Webkit系（Chrome, Safari, Edge） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #b0b0b0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #888;
}

::-webkit-scrollbar-corner {
  background: #f0f0f0;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #b0b0b0 #f0f0f0;
}

/* ダークモード時のスクロールバー */
body.DarkMode ::-webkit-scrollbar-track {
  background: #1a1a2e;
}

body.DarkMode ::-webkit-scrollbar-thumb {
  background: #4a4a6a;
}

body.DarkMode ::-webkit-scrollbar-thumb:hover {
  background: #6a6a8a;
}

body.DarkMode ::-webkit-scrollbar-corner {
  background: #1a1a2e;
}

body.DarkMode * {
  scrollbar-color: #4a4a6a #1a1a2e;
}

/* 2. HTML・BODY */
html,
body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #f5f5f5;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* 3. スピンボタンを非表示(Chrome, Safari, Edge, Operaで有効) */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ==========================================================================
 * ダークモード
 * ========================================================================== */
body.DarkMode {
  height: 100%;
  color: #e0e0e0;
  background-color: #1a1a2e;
}

body.DarkMode .ContentArea {
  background-color: #16213e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.DarkMode .Sidebar {
  background-color: #0f0f23;
}

body.DarkMode .SidebarHeader {
  border-bottom-color: #2a2a4a;
}

body.DarkMode .SidebarFooter {
  border-top-color: #2a2a4a;
}

body.DarkMode .SidebarItem:hover {
  background-color: #2a2a4a;
}

body.DarkMode .InputForm,
body.DarkMode .SelectForm,
body.DarkMode .TextAreaForm {
  background-color: #1a1a2e;
  border-color: #3a3a5a;
  color: #e0e0e0;
}

body.DarkMode .InputForm:focus,
body.DarkMode .SelectForm:focus,
body.DarkMode .TextAreaForm:focus {
  border-color: #3498db;
}

body.DarkMode .InputForm:disabled,
body.DarkMode .SelectForm:disabled {
  background-color: #2a2a4a;
}

body.DarkMode .SelectForm.placeholder {
  color: #999999;
}

body.DarkMode .SelectForm option {
  color: #e0e0e0;
  background-color: #1a1a2e;
}

body.DarkMode .SelectForm option:first-child {
  color: #999999;
}

body.DarkMode .DataTable {
  background-color: #16213e;
}

body.DarkMode .DataTable thead {
  background-color: #0f0f23;
}

body.DarkMode .DataTable th,
body.DarkMode .DataTable td {
  border-color: #3a3a5a;
}

body.DarkMode .DataTable tbody tr:hover {
  background-color: #2a2a4a;
}

body.DarkMode .Card {
  background-color: #16213e;
}

body.DarkMode .DialogContainer {
  background-color: #16213e;
}

body.DarkMode .DialogTitle {
  color: #e0e0e0;
}

body.DarkMode .PaginationButton {
  background-color: #16213e;
  border-color: #3a3a5a;
  color: #e0e0e0;
}

body.DarkMode .PaginationButton:hover:not(:disabled) {
  background-color: #3498db;
  border-color: #3498db;
}

body.DarkMode .ContentTitle {
  color: #e0e0e0;
}

body.DarkMode .WelcomeMessage {
  color: #a0a0a0;
}

body.DarkMode .UserIdDisplay {
  color: #e0e0e0;
}

body.DarkMode .RecordCount {
  color: #a0a0a0;
}

body.DarkMode .WorkTitle {
  background-color: #2a2a4a;
  color: #e0e0e0;
}

body.DarkMode .TabButton {
  color: #a0a0a0;
}

body.DarkMode .TabButton:hover {
  background-color: #2a2a4a;
}

body.DarkMode .TabButton.Active {
  color: #3498db;
}

body.DarkMode .RelationSidebar {
  background-color: #1a1a2e;
}

body.DarkMode .CharacterListItem {
  background-color: #16213e;
  border-color: #3a3a5a;
  color: #e0e0e0;
}

body.DarkMode .CharacterListItem:hover {
  background-color: #2a2a4a;
}

body.DarkMode .RelationCanvas {
  background-color: #16213e;
  border-color: #3a3a5a;
}

body.DarkMode .RelationObject {
  background-color: #1a1a2e;
  color: #e0e0e0;
}

body.DarkMode .TimelineContent {
  background-color: #1a1a2e;
  color: #e0e0e0;
}

body.DarkMode .TimelineTitle {
  color: #e0e0e0;
}

body.DarkMode .TimelineDesc {
  color: #a0a0a0;
}

body.DarkMode .ClassChartGroup {
  background-color: #16213e;
}

body.DarkMode .ClassChartNode {
  background-color: #1a1a2e;
}

body.DarkMode .ClassChartName {
  color: #e0e0e0;
}

body.DarkMode .ClassChartDesc {
  color: #a0a0a0;
}

body.DarkMode .StoryItem {
  background-color: #16213e;
  border-color: #3a3a5a;
}

body.DarkMode .StoryItem:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.DarkMode .StoryText {
  color: #e0e0e0;
}

body.DarkMode .CalendarDay {
  background-color: #16213e;
}

body.DarkMode .CalendarDay:hover {
  background-color: #2a2a4a;
}

body.DarkMode .CalendarDay.OtherMonth {
  background-color: #1a1a2e;
}

body.DarkMode .CalendarDay.Today {
  background-color: #2a3a4a;
}

/* ダークモードトグル */
.DarkModeToggle {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #ecf0f1;
  gap: 10px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.DarkModeToggle:hover {
  background-color: #34495e;
}

.DarkModeToggle i {
  width: 20px;
  text-align: center;
}

.ToggleSwitch {
  position: relative;
  width: 40px;
  height: 20px;
  background-color: #34495e;
  border-radius: 10px;
  margin-left: auto;
  transition: background-color 0.3s ease;
}

.ToggleSwitch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.DarkModeToggle.Active .ToggleSwitch {
  background-color: #3498db;
}

.DarkModeToggle.Active .ToggleSwitch::after {
  transform: translateX(20px);
}

/* ==========================================================================
 * ログイン画面
 * ========================================================================== */
/* 1. ログイン画面コンテナ */
.LoginContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  padding: 20px;
}

/* 2. ログインフォームカード */
.LoginCard {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

/* 3. ログインタイトル */
.LoginTitle {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  color: #2c3e50;
}

/* 4. ログインサブタイトル */
.LoginSubtitle {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 30px;
  font-size: 14px;
}

/* 5. ログインフォーム */
.LoginForm .FormGroup {
  margin-bottom: 20px;
}

/* 6. ログイン入力フォーム */
.LoginForm .InputForm {
  padding: 14px 15px;
  font-size: 15px;
}

/* 7. ログインフォームボタン */
.LoginForm .ButtonClass {
  padding: 14px 24px;
  font-size: 16px;
}

/* 8. ログインフォームボタンコンテナ */
.LoginButtonGroup {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
}

/* 9. ログインアイコン */
.LoginIcon {
  font-size: 50px;
  color: #667eea;
  text-align: center;
  margin-bottom: 20px;
}

/* 10.ログイン画面レスポンシブ対応 */
@media screen and (max-width: 480px) {
  .LoginCard {
    padding: 30px 20px;
  }
  .LoginTitle {
    font-size: 24px;
  }
}

/* ==========================================================================
 * 会員登録画面
 * ========================================================================== */
/* 1. 会員登録画面コンテナ */
.RegistrationContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  padding: 20px;
}

/* 2. 会員登録フォームカード */
.RegistrationCard {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

/* 3. 会員登録タイトル */
.RegistrationTitle {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  color: #2c3e50;
}

/* 4. 会員登録サブタイトル */
.RegistrationSubtitle {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 30px;
  font-size: 14px;
}

/* 5. 会員登録フォーム */
.RegistrationForm .FormGroup {
  margin-bottom: 20px;
}

/* 6. 会員登録入力フォーム */
.RegistrationForm .InputForm {
  padding: 14px 15px;
  font-size: 15px;
}

/* 7. 会員登録フォームボタン */
.RegistrationForm .ButtonClass {
  padding: 14px 24px;
  font-size: 16px;
}

/* 8. 会員登録フォームボタンコンテナ */
.RegistrationButtonGroup {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
}

/* 9. 会員登録アイコン */
.RegistrationIcon {
  font-size: 50px;
  color: #667eea;
  text-align: center;
  margin-bottom: 20px;
}

/* 10. 会員登録ヒントテキスト */
.HintText {
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 5px;
}

/* 11. 会員登録画面レスポンシブ対応 */
@media screen and (max-width: 480px) {
  .RegistrationCard {
    padding: 30px 20px;
  }
  .RegistrationTitle {
    font-size: 24px;
  }
}

/* ==========================================================================
 * レイアウト
 * ========================================================================== */
/* 1. ページコンテナ */
.PageContainer {
  display: flex;
  min-height: 100vh;
}

/* 2. メインコンテンツラッパー */
.MainContentWrapper {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* ==========================================================================
 * サイドバー
 * ========================================================================== */
/* 1. サイドバー */
.Sidebar {
  width: 250px;
  background-color: #2c3e50;
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  z-index: 11;
}

/* 2. サイドバーヘッダー */
.SidebarHeader {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #34495e;
}

/* 3. サイドバーヘッダーのタイトル */
.SidebarHeader h1 {
  font-size: 18px;
  font-weight: 600;
}

/* 4. サイドバーメニュー */
.SidebarMenu {
  flex: 1;
  padding: 10px 0;
}

/* 5. サイドバーメニューボタン */
.SidebarItem {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
  background: none;
  color: #ecf0f1;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
.SidebarItem:hover {
  background-color: #34495e;
}
.SidebarItem.Active {
  background-color: #3498db;
}

/* 6. サイドバーメニューボタンアイコン */
.SidebarItem i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* 7. サイドバーフッター */
.SidebarFooter {
  padding: 15px 20px;
  border-top: 1px solid #34495e;
}

/* 8. サイドバーバージョン表記 */
.SidebarVersion {
  text-align: center;
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 10px;
}

/* ==========================================================================
 * メイン画面
 * ========================================================================== */
/* 1. メインコンテンツ表示エリア */
.ContentArea {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 25px;
  min-height: calc(100vh - 80px);
}

.WelcomeMessage {
  font-size: 16px;
  color: #7f8c8d;
  margin-bottom: 5px;
}

.UserIdDisplay {
  font-weight: 600;
  color: #2c3e50;
}

.ActionButtons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ProjectTable {
  margin-top: 20px;
}

/* ==========================================================================
 * カード・パネル
 * ========================================================================== */
.Card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

.CardSmall {
  width: 100%;
  max-width: 400px;
}

.CardMedium {
  width: 100%;
  max-width: 600px;
}

.CardLarge {
  width: 100%;
  max-width: 900px;
}

.CardTitle {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

.ContentHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ContentTitle {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
}

/* ==========================================================================
 * フォーム要素
 * ========================================================================== */
.FormGroup {
  margin-bottom: 20px;
}

.InputForm {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.InputForm:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.InputForm:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.InputForm::placeholder {
  color: #999;
}

.SelectForm {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.SelectForm:focus {
  outline: none;
  border-color: #3498db;
}

.SelectForm:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* プルダウンのプレースホルダー表示（未選択状態） */
.SelectForm.placeholder {
  color: #999;
}

.SelectForm option {
  color: #333;
}

.SelectForm option:first-child {
  color: #999;
}

.TextAreaForm {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  min-height: 100px;
  resize: none;
  transition: border-color 0.2s ease;
}

.TextAreaForm:focus {
  outline: none;
  border-color: #3498db;
}

.InputWithButton {
  display: flex;
  gap: 10px;
}

.InputWithButton .InputForm {
  flex: 1;
}

/* ==========================================================================
 * ボタン
 * ========================================================================== */
.ButtonClass {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ButtonClass:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.PrimaryButton {
  background-color: #3498db;
  color: #fff;
}

.PrimaryButton:hover:not(:disabled) {
  background-color: #2980b9;
}

.SecondaryButton {
  background-color: #95a5a6;
  color: #fff;
}

.SecondaryButton:hover:not(:disabled) {
  background-color: #7f8c8d;
}

.SuccessButton {
  background-color: #27ae60;
  color: #fff;
}

.SuccessButton:hover:not(:disabled) {
  background-color: #219a52;
}

.DangerButton {
  background-color: #e74c3c;
  color: #fff;
}

.DangerButton:hover:not(:disabled) {
  background-color: #c0392b;
}

.WarningButton {
  background-color: #f39c12;
  color: #fff;
}

.WarningButton:hover:not(:disabled) {
  background-color: #d68910;
}

.SaveButton {
  background-color: #27ae60;
  color: #fff;
}

.SaveButton:hover:not(:disabled) {
  background-color: #219a52;
}

.CloseButton {
  background-color: #95a5a6;
  color: #fff;
}

.CloseButton:hover:not(:disabled) {
  background-color: #7f8c8d;
}

.ClearButton {
  background-color: #f39c12;
  color: #fff;
}

.ClearButton:hover:not(:disabled) {
  background-color: #d68910;
}

.DeleteButton {
  background-color: #e74c3c;
  color: #fff;
}

.DeleteButton:hover:not(:disabled) {
  background-color: #c0392b;
}

.ButtonGroup {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.ButtonGroupCenter {
  justify-content: center;
}

.ButtonGroupRight {
  justify-content: flex-end;
}

.ButtonGroupSpaceBetween {
  justify-content: space-between;
}

.ButtonSmall {
  padding: 8px 16px;
  font-size: 12px;
}

.ButtonFull {
  width: 100%;
}

/* ==========================================================================
 * タブ
 * ========================================================================== */
.TabContainer {
  margin-bottom: 20px;
}

.TabHeader {
  display: flex;
  border-bottom: 2px solid #3498db;
  margin-bottom: 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.TabButton {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.TabButton:hover {
  color: #3498db;
  background-color: #f8f9fa;
}

.TabButton.Active {
  color: #3498db;
  border-bottom-color: #3498db;
  font-weight: 600;
}

.TabContent {
  display: none;
}

.TabContent.Active {
  display: block;
}

/* ==========================================================================
 * テーブル
 * ========================================================================== */
.TableContainer {
  overflow-x: auto;
  margin-top: 20px;
}

.DataTable {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.DataTable th,
.DataTable td {
  padding: 12px;
  border: 1px solid #e0e0e0;
  white-space: nowrap;
}

.DataTable thead {
  background-color: #34495e;
  color: #fff;
}

.DataTable th {
  padding: 15px 12px;
  font-weight: 500;
}

.DataTable tbody tr {
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.DataTable tbody tr:hover {
  background-color: #f8f9fa;
}

.DataTable td {
  padding: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.DataTable .ActionCell {
  text-align: center;
  white-space: nowrap;
}

/* ==========================================================================
 * ページネーション
 * ========================================================================== */
.PaginationContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.PaginationButton {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.PaginationButton:hover:not(:disabled) {
  background-color: #3498db;
  color: #fff;
  border-color: #3498db;
}

.PaginationButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.PaginationButton.Active {
  background-color: #3498db;
  color: #fff;
  border-color: #3498db;
}

.PaginationInfo {
  color: #666;
  font-size: 14px;
}

.RecordCount {
  margin-bottom: 10px;
  color: #666;
  font-size: 14px;
}

/* ==========================================================================
 * ダイアログ
 * ========================================================================== */
.DialogOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.DialogContainer {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}

.DialogSmall {
  width: 90%;
  max-width: 400px;
}

.DialogMedium {
  width: 90%;
  max-width: 600px;
}

.DialogLarge {
  width: 90%;
  max-width: 800px;
}

.DialogTitle {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #2c3e50;
  text-align: center;
}

.DialogContent {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  white-space: pre-line;
}

.DialogButtonArea {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ==========================================================================
 * カラーピッカー
 * ========================================================================== */
.ColorPickerWrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ColorPicker {
  width: 50px;
  height: 40px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.ColorPicker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.ColorPicker::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.ColorCodeInput {
  flex: 1;
  max-width: 120px;
  font-family: monospace;
}

.FormLabel {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

/* ==========================================================================
 * スピナー
 * ========================================================================== */
.SpinnerOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.Spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: SpinnerAnimation 1s linear infinite;
}

@keyframes SpinnerAnimation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
 * 画像ボックス
 * ========================================================================== */
.ImageBox {
  width: 150px;
  height: 150px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ImageBox:hover {
  border-color: #3498db;
}

.ImageBox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ImageBoxPlaceholder {
  color: #999;
  text-align: center;
}

.ImageBoxPlaceholder i {
  font-size: 40px;
  margin-bottom: 10px;
}

/* ==========================================================================
 * チェックボックス
 * ========================================================================== */
.CheckboxWrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.CheckboxInput {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ==========================================================================
 * ユーティリティ
 * ========================================================================== */
.TextCenter {
  text-align: center;
}

.TextRight {
  text-align: right;
}

.TextLeft {
  text-align: left;
}

.MarginTop10 {
  margin-top: 10px;
}

.MarginTop20 {
  margin-top: 20px;
}

.MarginBottom10 {
  margin-bottom: 10px;
}

.MarginBottom20 {
  margin-bottom: 20px;
}

.Hidden {
  display: none !important;
}

.LinkText {
  color: #3498db;
  cursor: pointer;
  text-decoration: none;
}

.LinkText:hover {
  text-decoration: underline;
}

.ErrorText {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 5px;
}

.SuccessText {
  color: #27ae60;
  font-size: 12px;
  margin-top: 5px;
}

/* ==========================================================================
 * レスポンシブ対応
 * ========================================================================== */
@media screen and (max-width: 768px) {
  .Sidebar {
    position: fixed;
    left: -250px;
    height: 100%;
    z-index: 100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .Sidebar.Open {
    left: 0;
  }

  .SidebarMenu {
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    -webkit-overflow-scrolling: touch;
  }

  .MainContentWrapper {
    padding: 15px;
  }

  .Card {
    padding: 20px;
  }

  .CardTitle {
    font-size: 20px;
  }

  .ContentHeader {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .ButtonGroup {
    flex-wrap: wrap;
  }

  .DialogContainer {
    padding: 20px;
    margin: 10px;
  }

  .PaginationContainer {
    flex-wrap: wrap;
  }

  /* テーブルの縦型リスト表示（モバイル対応） */
  .TableContainer {
    overflow-x: visible;
  }

  .DataTable {
    display: block;
    box-shadow: none;
  }

  .DataTable thead {
    display: none;
  }

  .DataTable tbody {
    display: block;
  }

  .DataTable tbody tr {
    display: block;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .DataTable tbody tr:hover {
    background-color: #f8f9fa;
  }

  .DataTable td {
    display: block;
    text-align: left;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #eee;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .DataTable td:last-child {
    border-bottom: none;
  }

  .DataTable td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .DataTable td:empty::before {
    display: none;
  }

  .DataTable .ActionCell {
    text-align: left;
    padding-top: 12px;
  }

  .DataTable .ActionCell::before {
    display: none;
  }

  /* 操作列ボタンを3列1行で左揃え表示 */
  td[data-label='操作'] {
    display: grid !important;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 4px;
    border-bottom: none;
  }

  td[data-label='操作']::before {
    display: none;
  }

  td[data-label='操作'] .ButtonSmall {
    white-space: nowrap;
  }
}

/* ダークモード時のモバイルテーブル */
@media screen and (max-width: 768px) {
  body.DarkMode .DataTable tbody tr {
    background-color: #16213e;
    border-color: #3a3a5a;
  }

  body.DarkMode .DataTable tbody tr:hover {
    background-color: #2a2a4a;
  }

  body.DarkMode .DataTable td {
    border-bottom-color: #3a3a5a;
  }

  body.DarkMode .DataTable td::before {
    color: #8a8aaa;
  }
}

@media screen and (max-width: 480px) {
  .InputForm,
  .SelectForm,
  .TextAreaForm {
    padding: 10px 12px;
    font-size: 16px;
  }

  .ButtonClass {
    padding: 10px 16px;
    font-size: 14px;
  }

  .CardSmall,
  .CardMedium,
  .CardLarge {
    max-width: 100%;
  }
}

/* ==========================================================================
 * メニュートグルボタン（モバイル用）
 * ========================================================================== */
.MenuToggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 101;
  background-color: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 12px;
  cursor: pointer;
  height: 30px;
  width: 30px;
}

@media screen and (max-width: 768px) {
  .MenuToggle {
    display: block;
  }
}

/* ==========================================================================
 * オーバーレイ（モバイルメニュー用）
 * ========================================================================== */
.SidebarOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.SidebarOverlay.Open {
  display: block;
}

/* ==========================================================================
 * 作品管理画面
 * ========================================================================== */
/* 1. 作品タイトル */
.WorkTitle {
  font-size: 18px;
  color: #2c3e50;
  margin-bottom: 20px;
  padding: 10px 15px;
  background-color: #ecf0f1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.WorkTitle i {
  color: #3498db;
}

/* 2. サイドバーサブメニュー */
.SidebarSubMenu {
  padding-left: 20px;
  font-size: 13px;
}

.SidebarSubMenu .SidebarItem {
  padding: 10px 15px;
}

/* 3. サイドバー区切り線 */
.SidebarDivider {
  height: 1px;
  background-color: #34495e;
  margin: 10px 15px;
}

/* 4. フォーム行 */
.FormRow {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.FormRow .FormGroup {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

/* ==========================================================================
 * 相関図
 * ========================================================================== */
.RelationContainer {
  display: flex;
  gap: 20px;
  height: calc(100vh - 200px);
  min-height: 600px;
}

.RelationSidebar {
  width: 200px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
}

.RelationSidebarTitle {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #2c3e50;
}
.RelationCharaListmWrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}
.RelationCharaList {
  width: 100%;
  max-width: 320px;
}
.CharacterListItem {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: grab;
  font-size: 12px;
  transition: all 0.2s ease;
}

.CharacterListItem:hover {
  background: #e3f2fd;
  border-color: #3498db;
}

.CharacterListItem.dragging {
  opacity: 0.5;
}

.RelationCanvas {
  flex: 1;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  position: relative;
  overflow: auto;
}

.RelationCanvasContent {
  position: relative;
  width: 3000px;
  height: 3000px;
  transform-origin: top left;
}

.RelationCanvasSvg {
  position: absolute;
  top: 0;
  left: 0;
  width: 3000px;
  height: 3000px;
  pointer-events: none;
  z-index: 20;
}

.RelationCanvasSvg line,
.RelationCanvasSvg path {
  pointer-events: stroke;
  cursor: pointer;
}

.RelationObject {
  position: absolute;
  background: #fff;
  border: 2px solid #3498db;
  border-radius: 8px;
  padding: 10px;
  cursor: move;
  min-width: 80px;
  text-align: center;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.RelationObject.selected {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.RelationObject img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 5px;
}

.RelationGroupBox {
  position: absolute;
  border: 2px dashed #9b59b6;
  border-radius: 12px;
  padding: 10px;
  background: rgba(155, 89, 182, 0.05);
  z-index: 1;
}

.RelationGroupLabel {
  position: absolute;
  top: -12px;
  left: 10px;
  background: #9b59b6;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.RelationResizeHandle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #9b59b6;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  z-index: 10;
}

.RelationResizeHandle.resize-se {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.RelationResizeHandle.resize-sw {
  left: -6px;
  bottom: -6px;
  cursor: nesw-resize;
}

.RelationResizeHandle.resize-ne {
  right: -6px;
  top: -6px;
  cursor: nesw-resize;
}

.RelationResizeHandle.resize-nw {
  left: -6px;
  top: -6px;
  cursor: nwse-resize;
}

.RelationResizeHandle.resize-e {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.RelationResizeHandle.resize-w {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.RelationResizeHandle.resize-n {
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.RelationResizeHandle.resize-s {
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.RelationGroupBox:hover .RelationResizeHandle {
  opacity: 1;
}

.RelationGroupBox .RelationResizeHandle {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.RelationGroupBox.resizing .RelationResizeHandle {
  opacity: 1;
}

.TrashZone {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 50px;
  height: 50px;
  background: #f8f9fa;
  border: 2px dashed #e74c3c;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #e74c3c;
  font-size: 24px;
  transition: all 0.2s ease;
  z-index: 100;
}

.TrashZone.active {
  background: #fee;
  border-style: solid;
  transform: scale(1.1);
}

/* ズーム・ゴミ箱コントロール */
.RelationCanvasControls {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 50;
}

.RelationCanvasControls .TrashZone {
  position: static;
}

.ZoomButton {
  width: 50px;
  height: 50px;
  background: #f8f9fa;
  border: 2px solid #3498db;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #3498db;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ZoomButton:hover {
  background: #e3f2fd;
  border-color: #2980b9;
}

.ZoomButton:active {
  transform: scale(0.95);
}

/* 関係性タイプ選択 */
.RelationTypeSelector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.RelationTypeOption {
  padding: 8px 16px;
  border: 2px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  color: var(--type-color);
}

.RelationTypeOption:hover {
  border-color: #3498db;
}

.RelationTypeOption.selected {
  border-color: var(--type-color);
  background: var(--type-color);
  color: #fff !important;
}

/* 相関図モバイル対応 */
@media screen and (max-width: 768px) {
  .RelationContainer {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  .RelationSidebar {
    width: 100%;
    height: 200px;
    overflow-y: auto;
  }

  .RelationCanvas {
    width: 100%;
    height: calc(100vh - 400px);
    min-height: 400px;
    overflow: auto;
  }
}

/* ==========================================================================
 * ストーリー・プロット
 * ========================================================================== */
.StoryList {
  margin-top: 20px;
}

.StoryItem {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: grab;
  transition: all 0.2s ease;
}

.StoryItem:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.StoryItem.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.StoryItem.drag-over {
  border-color: #3498db;
  background: #e3f2fd;
}

.StoryNumber {
  width: 30px;
  height: 30px;
  background: #3498db;
  color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 12px;
  margin-right: 15px;
  flex-shrink: 0;
}

.StoryContent {
  flex: 1;
}

.StoryNarrator {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.StoryText {
  font-size: 14px;
  line-height: 1.6;
}

.PlotBadge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 10px;
}

.PlotBadge.ki {
  background: #e3f2fd;
  color: #1976d2;
}

.PlotBadge.sho {
  background: #e8f5e9;
  color: #388e3c;
}

.PlotBadge.ten {
  background: #fff3e0;
  color: #f57c00;
}

.PlotBadge.ketsu {
  background: #fce4ec;
  color: #c2185b;
}

/* ==========================================================================
 * カレンダー
 * ========================================================================== */
.CalendarContainer {
  margin-top: 20px;
}

.CalendarHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #3498db;
  border-radius: 8px;
  color: #fff;
}

.CalendarHeader h3 {
  margin: 0;
  font-size: 18px;
}

.CalendarNavButton {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.CalendarNavButton:hover {
  background: rgba(255, 255, 255, 0.3);
}

.CalendarGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background-color: #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.CalendarDayHeader {
  background-color: #34495e;
  color: #fff;
  text-align: center;
  padding: 10px 5px;
  font-size: 12px;
  font-weight: bold;
}

.CalendarDayHeader.Sunday {
  color: #ff6b6b;
}

.CalendarDayHeader.Saturday {
  color: #74b9ff;
}

.CalendarDay {
  background-color: #fff;
  min-height: 80px;
  padding: 5px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.CalendarDay:hover {
  background-color: #ecf0f1;
}

.CalendarDay.OtherMonth {
  background-color: #f8f9fa;
  color: #aaa;
}

.CalendarDay.Today {
  background-color: #fff9c4;
}

.CalendarDayNumber {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 5px;
}

.CalendarDay.Sunday .CalendarDayNumber {
  color: #e74c3c;
}

.CalendarDay.Saturday .CalendarDayNumber {
  color: #3498db;
}

.CalendarEvent {
  font-size: 10px;
  padding: 2px 4px;
  margin-bottom: 2px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: #fff;
  background-color: #3498db;
}

.CalendarEvent:hover {
  opacity: 0.8;
}

.CalendarMoreEvents {
  font-size: 10px;
  color: #666;
  text-align: center;
  margin-top: 2px;
}

.CalendarMoreEventsLink {
  cursor: pointer;
  color: #3498db;
  text-decoration: underline;
}

.CalendarMoreEventsLink:hover {
  color: #2980b9;
}

/* 日付スケジュール一覧 */
.DayScheduleList {
  overflow-x: hidden;
  max-height: 300px;
  overflow-y: auto;
}

.DayScheduleItem {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.DayScheduleItem:hover {
  background: #e9ecef;
  transform: translateX(3px);
}

.DayScheduleTitle {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.DaySchedulePeriod {
  font-size: 12px;
  color: #7f8c8d;
}

/* スケジュール詳細モーダル */
.ScheduleColorPicker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.ColorOption {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.ColorOption:hover {
  transform: scale(1.1);
}

.ColorOption.Selected {
  border-color: #2c3e50;
}

@media screen and (max-width: 768px) {
  .CalendarDay {
    min-height: 60px;
    padding: 3px;
  }
  .CalendarDayNumber {
    font-size: 10px;
  }
  .CalendarEvent {
    font-size: 8px;
    padding: 1px 2px;
  }
}

/* ==========================================================================
 * 年表ビジュアル表示
 * ========================================================================== */
.TimelineVisual {
  position: relative;
  padding: 20px 0;
  max-width: 900px;
  margin: 0 auto;
}

.TimelineVisual::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3498db 0%, #9b59b6 100%);
  transform: translateX(-50%);
  border-radius: 2px;
}

.TimelineItem {
  position: relative;
  width: 50%;
  padding: 10px 30px;
  box-sizing: border-box;
}

.TimelineItem::before {
  content: '';
  position: absolute;
  top: 20px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 4px solid #3498db;
  border-radius: 50%;
  z-index: 1;
}

.TimelineLeft {
  left: 0;
  padding-right: 40px;
  text-align: right;
}

.TimelineLeft::before {
  right: -8px;
}

.TimelineRight {
  left: 50%;
  padding-left: 40px;
  text-align: left;
}

.TimelineRight::before {
  left: -8px;
}

.TimelineContent {
  text-align: left;
  background: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #3498db;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.TimelineContent:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.TimelineRight .TimelineContent {
  border-left: none;
  border-right: 4px solid #9b59b6;
}

.TimelineDate {
  font-size: 12px;
  font-weight: 600;
  color: #3498db;
  margin-bottom: 5px;
}

.TimelineRight .TimelineDate {
  color: #9b59b6;
}

.TimelineTitle {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.TimelineDesc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

@media screen and (max-width: 768px) {
  .TimelineVisual::before {
    left: 20px;
  }

  .TimelineItem {
    width: 100%;
    padding-left: 50px;
    padding-right: 15px;
    text-align: left;
  }

  .TimelineLeft,
  .TimelineRight {
    left: 0;
  }

  .TimelineLeft::before,
  .TimelineRight::before {
    left: 12px;
    right: auto;
  }

  .TimelineContent,
  .TimelineRight .TimelineContent {
    border-left: 4px solid #3498db;
    border-right: none;
  }

  .TimelineRight .TimelineDate {
    color: #3498db;
  }
}

/* ==========================================================================
 * 階級組織図表示（階層図形式）
 * ========================================================================== */
.ClassChart {
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.ClassChartGroup {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  min-width: 300px;
  flex: 1;
  max-width: 100%;
}

.ClassChartGroupTitle {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #fff;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ClassChartGroupTitle i {
  font-size: 18px;
}

.ClassChartHierarchy {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* 序列ごとの行（横並び） */
.ClassChartRankRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  width: 100%;
  position: relative;
  padding: 10px 0;
}

/* 行間の縦線 */
.ClassChartRankRow:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, #3498db, #9b59b6);
  border-radius: 2px;
}

/* 序列ラベル */
.ClassChartRankLabel {
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #3498db;
  margin-bottom: 5px;
  padding: 3px 10px;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 10px;
  display: inline-block;
}

.ClassChartItem {
  position: relative;
  cursor: pointer;
}

.ClassChartNode {
  background: #f8f9fa;
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  min-width: 150px;
  text-align: center;
}

.ClassChartNode:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.ClassChartRank {
  font-size: 11px;
  font-weight: 600;
  color: #3498db;
  margin-bottom: 3px;
}

.ClassChartName {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
}

.ClassChartDesc {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  line-height: 1.4;
}

@media screen and (max-width: 768px) {
  .ClassChart {
    flex-direction: column;
    padding: 10px;
  }

  .ClassChartGroup {
    max-width: 100%;
    min-width: auto;
  }
}

/* ==========================================================================
 * 経歴カード表示
 * ========================================================================== */
.BiographyCardContainer {
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.BiographyCardGroup {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  min-width: 300px;
  flex: 1;
  max-width: 500px;
  overflow: hidden;
}

.BiographyCardGroupTitle {
  padding: 15px 20px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.BiographyCardGroupBody {
  padding: 10px;
}

.BiographyCardItem {
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  background: #f8f9fa;
  margin-bottom: 8px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.BiographyCardItem:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #edf2f7;
}

.BiographyCardDate {
  font-size: 12px;
  color: #7f8c8d;
  margin-bottom: 4px;
}

.BiographyCardContent {
  font-size: 14px;
  color: #2c3e50;
}

body.DarkMode .BiographyCardGroup {
  background: #1e293b;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.DarkMode .BiographyCardGroupTitle {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

body.DarkMode .BiographyCardItem {
  background: #334155;
  border-left-color: #2563eb;
}

body.DarkMode .BiographyCardItem:hover {
  background: #475569;
}

body.DarkMode .BiographyCardDate {
  color: #94a3b8;
}

body.DarkMode .BiographyCardContent {
  color: #e2e8f0;
}

@media screen and (max-width: 768px) {
  .BiographyCardContainer {
    flex-direction: column;
    padding: 10px;
  }

  .BiographyCardGroup {
    max-width: 100%;
    min-width: auto;
  }
}

/* ==========================================================================
 * AI相談チャットUI
 * ========================================================================== */
/* 1. メインコンテナ */
.AIConversationContainer {
  display: flex;
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 700px;
}

/* 2. 会話履歴パネル（左側） */
.ConversationListPanel {
  width: 300px;
  background: #f8f9fa;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ConversationListHeader {
  padding: 15px;
  background: #34495e;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ConversationListHeader h3 {
  margin: 0;
  font-size: 14px;
}

.ConversationListBody {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.ConversationListItem {
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.ConversationListItem:hover {
  border-color: #3498db;
  background: #e3f2fd;
}

.ConversationListItem.Active {
  border-color: #3498db;
  background: #e3f2fd;
}

.ConversationListItem.Archived {
  opacity: 0.6;
  background: #f5f5f5;
}

.ConversationListItemTitle {
  font-size: 13px;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ConversationListItemMeta {
  font-size: 11px;
  color: #7f8c8d;
  display: flex;
  justify-content: space-between;
}

.ConversationListFooter {
  padding: 10px;
  border-top: 1px solid #e0e0e0;
}

/* 3. チャットパネル（右側） */
.ChatPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.ChatHeader {
  padding: 15px;
  background: #3498db;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ChatHeader h3 {
  margin: 0;
  font-size: 16px;
}

.ChatHeaderActions {
  display: flex;
  gap: 8px;
}

.ChatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #e5ddd5;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 4. メッセージバブル */
.MessageBubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

.MessageBubble.User {
  align-self: flex-end;
  background: #dcf8c6;
  border-bottom-right-radius: 4px;
}

.MessageBubble.AI {
  align-self: flex-start;
  background: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.MessageBubble pre {
  background: #f4f4f4;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
  margin: 8px 0;
}

.MessageBubble code {
  background: #f4f4f4;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 12px;
}

.MessageTime {
  font-size: 10px;
  color: #999;
  margin-top: 4px;
  text-align: right;
}

/* 5. タイプライターカーソル */
.TypewriterCursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #333;
  margin-left: 2px;
  animation: TypewriterBlink 0.7s infinite;
}

@keyframes TypewriterBlink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* 6. 入力エリア */
.ChatInputArea {
  padding: 15px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ChatInputArea .TextAreaForm {
  flex: 1;
}

/* 8. ローディング表示 */
.ChatLoading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ChatLoadingDots {
  display: flex;
  gap: 4px;
}

.ChatLoadingDots span {
  width: 8px;
  height: 8px;
  background: #bdc3c7;
  border-radius: 50%;
  animation: ChatLoadingBounce 1.4s infinite ease-in-out both;
}

.ChatLoadingDots span:nth-child(1) {
  animation-delay: -0.32s;
}
.ChatLoadingDots span:nth-child(2) {
  animation-delay: -0.16s;
}
.ChatLoadingDots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes ChatLoadingBounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* 9. 空状態表示 */
.ChatEmptyState {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #7f8c8d;
  text-align: center;
  padding: 40px;
}

.ChatEmptyState i {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.ChatEmptyState p {
  font-size: 14px;
  margin: 5px 0;
}

/* 10. アーカイブダイアログ */
.ArchiveActions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* 11. ダークモード対応 */
body.DarkMode .ConversationListPanel {
  background: #1a1a2e;
}

body.DarkMode .ConversationListItem {
  background: #16213e;
  border-color: #3a3a5a;
  color: #e0e0e0;
}

body.DarkMode .ConversationListItem:hover,
body.DarkMode .ConversationListItem.Active {
  background: #2a2a4a;
  border-color: #3498db;
}

body.DarkMode .ConversationListItemTitle {
  color: #e0e0e0;
}

body.DarkMode .ConversationListItemMeta {
  color: #8a8aaa;
}

body.DarkMode .ConversationListFooter {
  border-top-color: #3a3a5a;
}

body.DarkMode .ChatPanel {
  background: #16213e;
  border-color: #3a3a5a;
}

body.DarkMode .ChatMessages {
  background: #1a1a2e;
}

body.DarkMode .MessageBubble.User {
  background: #075e54;
  color: #e0e0e0;
}

body.DarkMode .MessageBubble.AI {
  background: #2a2a4a;
  color: #e0e0e0;
}

body.DarkMode .MessageBubble pre,
body.DarkMode .MessageBubble code {
  background: #16213e;
  color: #e0e0e0;
}

body.DarkMode .ChatInputArea {
  background: #16213e;
  border-top-color: #3a3a5a;
}

body.DarkMode .ChatInputArea .TextAreaForm {
  background: #1a1a2e;
  border-color: #3a3a5a;
  color: #e0e0e0;
}

body.DarkMode .ChatInputArea .TextAreaForm:focus {
  border-color: #3498db;
}

body.DarkMode .ChatPanel .CheckboxWrapper {
  background: #16213e;
  border-top-color: #3a3a5a;
  color: #a0a0a0;
}

body.DarkMode .ChatLoading {
  background: #2a2a4a;
}

body.DarkMode .TypewriterCursor {
  background: #e0e0e0;
}

/* 12. レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .AIConversationContainer {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  .ConversationListPanel {
    width: 100%;
    height: 400px;
  }

  .ChatPanel {
    height: calc(100vh - 600px);
    min-height: 600px;
  }

  .MessageBubble {
    max-width: 85%;
  }
}
