/* 新オキニリストのstyles.css */

/* リセットとベーススタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "HelveticaNeue", "Helvetica", "HiraginoSans",
    "HiraginoKakuGothicProN", "Arial", "YuGothic", "Meiryo", sans-serif;
  color: #555555;
  font-size: 14px;
  touch-action: manipulation;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ズーム・コンテキストメニュー防止 */
html,
body,
div,
span,
p,
a,
img,
ul,
li,
table,
tr,
td,
th,
.cast-container,
.shift-schedule,
.cast-bottom,
.filter-window,
.modal,
.search-window,
#casts,
#pagination {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

* {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation !important;
}

input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.cast-left img,
button,
a,
input,
select,
.tag {
  pointer-events: auto;
}

.cast-left img {
  /* サイズ指定 */
  width: 108px;
  height: 108px;
  object-fit: cover;

  /* レイアウト */
  display: block;
  margin: 0 auto;

  /* スタイル */
  border-radius: 8px;
  background-color: #f9f9f9;
  border: 1px solid #eee;

  /* エフェクト */
  box-shadow: 0 4px 11px 0 rgba(37, 44, 97, 0.15),
    0 1px 3px 0 rgba(93, 100, 148, 0.2);

  /* インタラクション */
  touch-action: auto;
  pointer-events: auto;

  /* 配置 */
  position: relative;
}

/* 画像が読み込まれない場合のプレースホルダー */
.cast-left img[src=""],
.cast-left img[src*="null"],
.cast-left img:not([src]),
.cast-detail-left img[src=""],
.cast-detail-left img[src*="null"],
.cast-detail-left img:not([src]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 430.963 78'%3E%3Cpath fill='%23FF6B81' d='M206.836,15v14h-55V15H206.836z M144.836,57v14h73V57H144.836z M394.463,45.083l-38.627-19.539V0h-14 v78h14V41.247l32.202,16.317L394.463,45.083z M330.836,8h-56v14h33.654l-41.334,41.334l9.898,9.9l24.453-24.453L329.2,69.053 l8.268-11.297l-26.219-18.992L330.836,22V8z M231.233,51.574l-13.994,0.341L215.643,0h13.995L231.233,51.574z M266.448,0h-13.93 l-8.09,78h13.93L266.448,0z M143.836,29V15h-22.222l-2.179-15h-13.429l1.896,15H86.836v14h23.102l1.745,12H81.836v13h31.738 l3.593,24h13.429l-3.309-24h16.549V41h-18.44l-1.746-12H143.836z M47.176,78H60.98l4.243-45h15l1.292-14h-15l1.66-19h-14l-1.66,19 h-40l-1.292,14h27.271L0,68.244l8.709,9.596l41.919-38.377l-1.856,20.121l-4.92-5.422l-10.381,9.189L47.176,78z M400.926,48.4 l4.793-31.816l3.939-16.287l21.305,6.088L425.7,22.294l-12.652,29.571L400.926,48.4z M402.487,53.771 c-6.451,0-11.68,5.229-11.68,11.68s5.229,11.68,11.68,11.68s11.68-5.229,11.68-11.68S408.938,53.771,402.487,53.771z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60% auto;
  background-color: #f9f9f9;
  opacity: 0.3;
  min-height: 150px; /* 最小の高さを確保 */
}

/* エラー時のプレースホルダー（画像が404などでロードに失敗した場合） */
.cast-left img.placeholder,
.cast-detail-left img.placeholder {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 430.963 78'%3E%3Cpath fill='%23FF6B81' d='M206.836,15v14h-55V15H206.836z M144.836,57v14h73V57H144.836z M394.463,45.083l-38.627-19.539V0h-14 v78h14V41.247l32.202,16.317L394.463,45.083z M330.836,8h-56v14h33.654l-41.334,41.334l9.898,9.9l24.453-24.453L329.2,69.053 l8.268-11.297l-26.219-18.992L330.836,22V8z M231.233,51.574l-13.994,0.341L215.643,0h13.995L231.233,51.574z M266.448,0h-13.93 l-8.09,78h13.93L266.448,0z M143.836,29V15h-22.222l-2.179-15h-13.429l1.896,15H86.836v14h23.102l1.745,12H81.836v13h31.738 l3.593,24h13.429l-3.309-24h16.549V41h-18.44l-1.746-12H143.836z M47.176,78H60.98l4.243-45h15l1.292-14h-15l1.66-19h-14l-1.66,19 h-40l-1.292,14h27.271L0,68.244l8.709,9.596l41.919-38.377l-1.856,20.121l-4.92-5.422l-10.381,9.189L47.176,78z M400.926,48.4 l4.793-31.816l3.939-16.287l21.305,6.088L425.7,22.294l-12.652,29.571L400.926,48.4z M402.487,53.771 c-6.451,0-11.68,5.229-11.68,11.68s5.229,11.68,11.68,11.68s11.68-5.229,11.68-11.68S408.938,53.771,402.487,53.771z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60% auto;
  background-color: #f9f9f9;
  opacity: 0.3;
}

h1 {
  font-size: 1em;
  margin-bottom: 20px;
}

/* 共通スタイル */
.highlight {
  color: #ff6b81;
  font-weight: bold;
}

.shift-schedule::-webkit-scrollbar {
  display: none;
}

.shift-schedule,
.cast-bottom {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* シャドウ効果 */
.cast-container {
  box-shadow: 0 2px 5px 0 rgba(37, 44, 97, 0.15),
    0 1px 3px 0 rgba(93, 100, 148, 0.2);
}

.shift-box {
  box-shadow: 0 1px 4px 0 rgba(37, 44, 97, 0.15),
    0 1px 4px 0 rgba(93, 100, 148, 0.2);
}

.filter-apply {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.area-button,
.prefecture-button {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.area-button:hover,
.prefecture-button:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.modal {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.modal-header {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-container {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ヘッダーとナビゲーション（元の状態に戻す） */
.main-header {
  display: flex;
  justify-content: space-between; /* center から space-between に戻す */
  align-items: center;
  padding: 10px 10px;
  background-color: white;
  /* position: relative; を削除 */
}

.header-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  /* position: absolute; を削除 */
  /* right: 10px; を削除 */
}

.header-top-row {
  margin-bottom: 15px;
  margin-top: 0;
  padding-top: 0;
}

.header-bottom-row {
  display: flex;
  gap: 15px;
}

.login-button {
  text-decoration: none;
  color: #555555;
  font-size: 0.9em;
  font-weight: bold;
  cursor: pointer;
  display: inline-block;
  margin-top: 0;
  padding-top: 0;
}

.tag-button,
.okini-button {
  display: flex;
  align-items: center;
  font-size: 0.9em;
  font-weight: bold;
  color: #555555;
  cursor: pointer;
}

.tag-button svg,
.okini-button svg {
  margin-right: 5px;
  stroke: #555555;
}

/* キャスト表示 */
.cast-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  padding: 5px;
}

.cast-top {
  display: flex;
  align-items: flex-start; /* centerから変更 */
}

.cast-left {
  width: 120px;
  margin-right: 5px;
  margin-left: 0;
  padding: 5px;
  text-align: center;
}

.cast-right {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.store-info {
  font-size: 1em;
  margin-bottom: 5px;
  text-align: left;
}

.store-info p {
  font-size: 0.6em;
  line-height: 1.4em;
}

.cast-name {
  font-weight: bold;
  font-size: 1.3em;
  margin-bottom: 2px;
  line-height: 1.2;
}

.cast-ruby {
  font-size: 0.7em;
  color: #888;
  margin-bottom: 5px;
  line-height: 1.2;
}

.cast-data {
  font-size: 0.9em;
  margin-bottom: 3px;
  line-height: 1.3;
}

/* タグエリア（旧オキニリスト準拠） */
.cast-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.cast-tags .tag {
  color: rgb(139, 92, 246); /* 旧オキニリストの紫色 */
  font-size: 0.8em;
  margin-right: 8px;
  white-space: nowrap;
  line-height: 1.2;
  display: inline-block;
  margin-bottom: 2px;
}

/* タグ編集ボタン */
.tag-edit-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 5px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.tag-edit-btn:hover {
  opacity: 1;
}

.tag-placeholder {
  color: #999;
  font-style: italic;
  font-size: 0.75em;
}

/* ========== タグモーダルスタイル ========== */
.tag-modal-overlay {
  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;
}

.tag-modal {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.tag-modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag-modal-header h3 {
  margin: 0;
  color: #ff6b81;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.tag-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.tag-checkbox {
  display: block;
  margin-bottom: 12px;
  cursor: pointer;
}

.tag-checkbox input {
  margin-right: 8px;
}

.tag-name {
  color: rgb(139, 92, 246);
  font-size: 14px;
}

.tag-modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-save,
.btn-cancel {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-save {
  background-color: #ff6b81;
  color: white;
}

.btn-cancel {
  background-color: #ccc;
  color: #333;
}

.cast-bottom {
  margin: 3px 3px;
  color: rgb(139, 92, 246);
  font-size: 1em;
  height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-wrap: wrap;
}

.tag {
  margin-right: 10px;
  white-space: nowrap;
  line-height: 1.2;
}

/* シフトスケジュール */
.shift-schedule {
  margin-bottom: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  width: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 作品サムネイル横スクロールエリア */
.work-item-placeholder {
  width: 60px;
  height: 85px;
  background-color: #ccc;
  border-radius: 4px;
  margin: 2px auto;
  display: block;
}

/* 横スクロールテーブルの調整 */
.shift-schedule table {
  border-collapse: separate;
  border-spacing: 2px;
  width: auto;
  min-width: 100%;
}

.shift-schedule td {
  vertical-align: top;
  text-align: center;
  padding: 2px;
  min-width: 64px;
  width: 64px;
}

.shift-date {
  font-size: 0.9em;
  margin-bottom: 3px;
}

.shift-box {
  font-size: 0.9em;
  min-height: 60px;
  min-width: 80px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

.shift-time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.4;
}

/* ページネーション */
.total-count {
  text-align: center;
  color: #666;
  font-size: 0.9em;
  margin: 5px 0 10px;
}

#pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 15px;
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
}

#pagination-info {
  margin-top: 15px;
}

.page-numbers {
  font-size: 1.6em;
  color: #666;
  margin: 0 15px;
  text-align: center;
}

/* ページネーションボタンの強化版 */
#pagination .page-nav-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #6b6b6b !important;
  color: white !important;
  border: none !important;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin: 0;
  padding: 0;

  /* 🎯 強力なタッチ制御 */
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;

  /* 🎯 選択防止の強化 */
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-select: none !important;

  /* 🎯 アウトライン完全無効化 */
  outline: none !important;
  outline-offset: 0 !important;

  transition: transform 0.1s, background-color 0.1s;
}

/* ページネーション全体にも適用 */
#pagination {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

#pagination .page-nav-button:active,
#pagination .page-nav-button:hover {
  transform: scale(0.95);
  background-color: #555 !important;
}

#pagination .page-nav-button svg {
  width: 20px;
  height: 20px;
  stroke: white;
  stroke-width: 3px;
}

#pagination .page-nav-button:disabled {
  opacity: 0;
  pointer-events: none;
  touch-action: none;
}

#pagination button {
  margin: 0;
  padding: 0;
}

#pagination button.active {
  background-color: #6b6b6b !important;
  color: white !important;
  border: none !important;
}

#pagination button:hover:not(.active) {
  background-color: #555 !important;
}

/* フィルターとボタン */
.filter-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 10px;
  padding: 0 10px;
}

.filter-header-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 5px;
  padding: 0 15px;
}

.today-only-label {
  font-size: 1em;
  font-weight: bold;
  display: flex;
  align-items: center;
}

#todayOnly {
  border-radius: 4px;
  height: 17px;
  width: 17px;
  border: 1px solid #c4c4c6;
  margin-right: 4px;
  -webkit-appearance: none;
  appearance: none;
  background-color: white;
  position: relative;
  cursor: pointer;
}

#todayOnly:checked {
  background-color: #ff6b81;
  border-color: #ff6b81;
}

#todayOnly:checked:after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 6px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-right {
  display: flex;
  align-items: center;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
}

.filter-right svg {
  margin-right: 5px;
  width: 1.3em;
  height: 1.3em;
}

.filter-right p {
  color: #555555;
}

.filter-right.filtered p {
  color: #ff6b81;
}

.today-label {
  color: #555555;
}

/* フィルターウィンドウ */
.filter-window {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  z-index: 2000;
  overflow-y: auto;
  font-size: 16px;
}

.filter-window-container {
  max-width: 100%;
  border: 1px solid #ddd;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 20px 20px 100px;
  background-color: white;
  position: relative;
  min-height: 100vh;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 5px 20px;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1000;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.filter-header .close-button {
  font-size: 2.3em;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  text-align: left;
  margin-left: 15px;
  padding: 0;
  line-height: 1;
}

.filter-header .result-count {
  color: #ff6b81;
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  flex-grow: 1;
}

.filter-header .clear-button {
  color: #666;
  font-size: 1.2em;
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  white-space: nowrap;
  margin-right: 15px;
  padding: 0;
}

.filter-section {
  margin-bottom: 30px;
}

.filter-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.filter-section-title {
  font-size: 1.1em;
  font-weight: bold;
  color: #333;
  margin-right: 20px;
}

.today-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8px;
}

.date-options {
  display: flex;
  flex-wrap: wrap;
  margin-left: 10%;
  padding-left: 10px;
}

.date-row {
  display: flex;
  width: 100%;
  margin-bottom: 15px;
}

.date-option {
  width: 50%;
  display: flex;
  align-items: center;
}

.date-label {
  font-size: 1.1em;
}

.radio-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 10px;
}

.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  position: relative;
  display: inline-block;
  height: 20px;
  width: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  margin-right: 8px;
}

.radio-container input:checked ~ .checkmark {
  background-color: #ff6b81;
  border-color: #ff6b81;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.radio-container input:checked ~ .checkmark:after {
  display: block;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
}

.filter-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  justify-content: flex-start;
  gap: 8px;
}

/* 🔧 修正: filter-selectのピンク色スタイルを削除してグレー統一 */
.filter-select {
  width: 110px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9em;
  background-color: white;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  color: #555555;
  cursor: pointer;
  transition: border-color 0.2s ease;
  -webkit-text-fill-color: #555555;
}

.filter-select:focus {
  outline: none;
  border-color: #bbb; /* ピンクからグレーに変更 */
  box-shadow: 0 0 0 2px rgba(187, 187, 187, 0.1); /* ピンクからグレーに変更 */
}

.filter-select option {
  color: #555555;
  padding: 8px;
}

.filter-range-separator {
  width: 40px;
  text-align: center;
  color: #666;
  font-weight: bold;
  flex-shrink: 0;
}

.filter-unit {
  width: 50px;
  text-align: left;
  color: #666;
  font-size: 0.9em;
  flex-shrink: 0;
}

.filter-apply {
  display: none;
  width: calc(100% - 40px);
  padding: 15px;
  background-color: #ff6b81;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  position: fixed;
  left: 20px;
  bottom: 20px;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(255, 107, 129, 0.3);
}

.filter-apply.visible {
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.filter-apply:hover {
  background-color: #ff5a70;
}

.filter-apply:active {
  transform: translateY(0) scale(0.98);
}

/* 絞り込みボタンのアクティブ状態 */
.filter-right.filtered svg line,
.filter-right.filtered svg circle {
  stroke: #ff6b81 !important;
}

/* 新着女優チェックボックスのラベルスタイル調整 */
.today-only-label {
  transition: color 0.2s ease;
}

.today-only-label label {
  transition: color 0.2s ease;
  cursor: pointer;
}

/* 🔧 削除: フィルター状態の視覚的フィードバック（ピンク色） */
/* 
.filter-select:not([value=""]):not([value="null"]) {
  border-color: #ff6b81;
  background-color: #fff9fa;
}
*/

/* フィルターセクションの区切り線 */
.filter-section:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 25px;
}

/* アニメーション効果 */
@keyframes filterWindowSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-window[style*="block"] .filter-window-container {
  animation: filterWindowSlideIn 0.3s ease-out;
}

/* フィルター適用ボタンのパルス効果 */
@keyframes filterButtonPulse {
  0% {
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.3);
  }
  50% {
    box-shadow: 0 6px 16px rgba(255, 107, 129, 0.5);
  }
  100% {
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.3);
  }
}

.filter-apply.visible {
  animation: filterButtonPulse 2s ease-in-out infinite;
}

/* エリア選択 */
.area-select-container {
  flex: 0 1 auto;
}

.area-select-button {
  padding: 5px 10px;
  border: 1px solid #555555;
  border-radius: 20px;
  background-color: white;
  color: #555555;
  font-size: 1em;
  cursor: pointer;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.area-select-button:hover {
  background-color: #fff0f2;
}

/* 並び替えボタンのアクティブ状態 */
.area-select-button.sort-active {
  background-color: #fff0f2;
  border-color: #ff6b81;
  color: #ff6b81;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  font-size: 16px;
  padding-bottom: 20px;
}

.modal.active {
  display: flex;
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 0 15px;
  height: 50px;
  background-color: #ff6b81;
  color: white;
  position: sticky;
  top: 0;
  z-index: 3010;
}

.modal-header h2 {
  margin: 0 auto;
  font-size: 1.1em;
  text-align: center;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 30px;
}

.close-modal-button,
.back-button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.2s;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.close-modal-button:hover,
.back-button:hover {
  opacity: 0.8;
}

.close-modal-button {
  left: 15px;
  font-size: 1.8em;
}

#prefectureSelectModal .close-modal-button {
  display: none;
}

.back-button {
  left: 15px;
  font-size: 0.9em;
  padding: 6px 10px;
  border: 1px solid white;
  border-radius: 5px;
  font-weight: bold;
  display: flex;
  align-items: center;
  color: white;
}

.back-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal-content {
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.area-button,
.prefecture-button {
  padding: 20px 15px;
  background-color: white;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 1.1em;
  cursor: pointer;
  position: relative;
  color: #555555;
  font-weight: bold;
  transition: background-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.area-button[data-next-modal] {
  position: relative;
  padding: 20px 15px;
}

.area-button[data-next-modal] span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: auto;
  z-index: 1;
}

.area-button[data-next-modal]::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border-top: 2px solid #ccc;
  border-right: 2px solid #ccc;
  pointer-events: none;
  z-index: 0;
}

.prefecture-button::after {
  display: none;
}

.prefecture-button.selected {
  background-color: #fff0f2;
  border-color: #ffc2cc;
  color: #ff6b81;
}

#prefectureSelectModal {
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 3005;
  background-color: white;
}

#prefectureSelectModal.active {
  transform: translateX(0);
  opacity: 1;
}

#prefectureList.single-column {
  grid-template-columns: 1fr;
}

#prefectureList.two-column {
  grid-template-columns: repeat(2, 1fr);
}

#prefectureList p {
  grid-column: 1/-1;
  text-align: center;
  color: #888;
  font-size: 0.9em;
  padding: 20px 0;
}

/* 検索関連の改良版CSS */
.search-button {
  display: flex;
  align-items: center;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
}

.search-button svg {
  margin-right: 5px;
  width: 1.3em;
  height: 1.3em;
}

.search-button p {
  color: #555555;
}

.search-button.active {
  color: #ff6b81;
}

.search-button.active svg {
  stroke: #ff6b81;
}

.search-button.active p {
  color: #ff6b81;
}

.search-window {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  z-index: 2000;
  overflow-y: auto;
  font-size: 16px;
}

.search-window-container {
  padding: 10px;
  background-color: #fff;
  width: 100%;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 5px 20px;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1000;
  border-bottom: 1px solid #eee;
}

.search-header h2 {
  text-align: center;
  flex-grow: 1;
  font-size: 1.2em;
  font-weight: bold;
}

.close-search-button {
  font-size: 2.3em;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  text-align: left;
  margin-left: 15px;
}

.search-content {
  padding: 20px 15px;
}

.search-input-container {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 50px;
  padding: 0 15px;
  background-color: #f5f5f5;
  height: 40px;
  margin-bottom: 30px;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 16px;
  outline: none;
}

.search-input::placeholder {
  color: #999;
}

.clear-search-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 1.2em;
  color: #999;
  cursor: pointer;
  display: none;
}

/* 🎨 検索履歴コンテナの改良 */
.search-history-container {
  padding: 10px 15px;
}

.search-history-title {
  font-size: 0.9em;
  color: #777;
  margin-bottom: 15px;
  font-weight: bold;
}

/* 🎨 検索履歴アイテムの美しいデザイン */
.search-history-item {
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 10px;
  padding: 8px 16px;
  background-color: #f0f0f0;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #555;
}

.search-history-item:hover {
  background-color: #e8e8e8;
  border-color: #d0d0d0;
}

.search-history-item:active {
  transform: scale(0.95);
}

/* 🎨 検索ボタンコンテナの改良 */
.search-buttons-container {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 30px;
}

.search-buttons-container .action-button {
  flex: 1;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95em;
  border: none;
  transition: all 0.2s ease;
}

/* 🎨 検索をクリアボタン（左側・白いボタン） */
.search-buttons-container .action-button:first-child {
  background-color: white;
  color: #666;
  border: 1px solid #ddd;
}

.search-buttons-container .action-button:first-child:hover {
  background-color: #f9f9f9;
  border-color: #ccc;
}

/* 🎨 検索ボタン（右側・グレーのボタン） */
.search-buttons-container .primary-button {
  background-color: #ff6b81;
  color: white;
  border: 1px solid #ff6b81;
}

.search-buttons-container .primary-button:hover:not(.disabled) {
  background-color: #777;
  border-color: #777;
}

/* 🎨 無効状態の検索ボタン */
.search-buttons-container .disabled {
  background-color: #aaa !important;
  color: white !important;
  border-color: #aaa !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

.search-buttons-container .disabled:hover {
  background-color: #ccc !important;
  border-color: #ccc !important;
  transform: none !important;
}

/* ログイン・会員登録 */
.auth-container {
  max-width: 500px;
  margin: 20px auto;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-weight: bold;
  color: #999;
  cursor: pointer;
}

.auth-tab.active {
  color: #ff6b81;
  border-bottom: 2px solid #ff6b81;
}

.auth-form-container {
  position: relative;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-info {
  margin-bottom: 20px;
  font-size: 1em;
  color: #555;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
}

.form-group input::placeholder {
  color: #aaa;
}

.auth-button {
  width: 100%;
  padding: 15px;
  background-color: #ff6b81;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 15px;
}

.auth-links {
  text-align: center;
  margin-top: 15px;
}

.auth-links a {
  color: #666;
  text-decoration: none;
  font-size: 0.9em;
}

.auth-links a:hover {
  text-decoration: underline;
  color: #ff6b81;
}

/* 認証関連のスタイル */
.back-to-home {
  text-decoration: none;
  color: inherit;
  display: block;
  margin-bottom: 20px;
}

.auth-subtitle {
  text-align: center;
  font-size: 1.5em;
  margin-bottom: 20px;
  color: #555;
}

.auth-messages {
  margin: 10px 0;
  padding: 0 10px;
}

.auth-message {
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  margin-bottom: 10px;
}

.auth-message.error {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.auth-message.success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

/* ログイン名表示（元の状態に戻す） */
.username-link {
  font-weight: bold;
  color: #ff6b81 !important;
  text-decoration: none;
  display: inline-block;
  cursor: pointer !important;
  pointer-events: auto !important;

  /* 🔄 追加した文字数制限を削除 */
  /* max-width: 70px; を削除 */
  /* white-space: nowrap; を削除 */
  /* overflow: hidden; を削除 */
  /* text-overflow: ellipsis; を削除 */
}

.username-link:hover {
  text-decoration: underline;
  color: #e55a72 !important;

  /* 🔄 追加したホバー効果を削除 */
  /* overflow: visible; を削除 */
  /* white-space: normal; を削除 */
  /* max-width: none; を削除 */
  /* background-color: rgba(255, 255, 255, 0.95); を削除 */
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); を削除 */
  /* border-radius: 4px; を削除 */
  /* padding: 4px 8px; を削除 */
  /* z-index: 1000; を削除 */
  /* position: relative; を削除 */
}

/* ユーザープロフィールページ */
.user-profile-container {
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-title {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 20px;
  color: #555;
  text-align: center;
}

.profile-section {
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

.profile-section h3 {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 15px;
  color: #555;
}

.profile-form {
  margin-bottom: 20px;
}

.profile-button {
  background-color: #ff6b81;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
}

.profile-button:hover {
  background-color: #ff5a6e;
}

.profile-actions {
  text-align: center;
  padding-top: 20px;
}

.logout-button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 15px;
  color: #555;
  cursor: pointer;
  font-size: 0.9em;
}

.logout-button:hover {
  background-color: #f5f5f5;
  color: #ff6b81;
}

/* ログインプロンプトモーダル用のスタイル */
.create-tag-modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
}

.create-tag-modal-header {
  background-color: #ff6b81;
  color: white;
  padding: 15px 20px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px 8px 0 0;
}

.create-tag-modal-title {
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
}

.create-tag-close-button {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 1.8em;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.create-tag-modal-body {
  padding: 20px;
  text-align: center;
}

.create-tag-button {
  background-color: #ff6b81;
  color: white;
  border: none;
  padding: 12px 20px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
  width: 100px;
  margin-left: auto;
  display: block;
}

.create-tag-button:hover {
  opacity: 0.9;
}

/* オキニハートマーク */
.okini-heart {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  vertical-align: -10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff6b81' stroke='%23ff6b81' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* ========== お気に入りハートアイコン（旧オキニリスト準拠） ========== */
.favorite-heart-icon {
  margin-right: 6px;
  display: inline-block;
  vertical-align: 0px; /* -2px → 0px に変更 */
  flex-shrink: 0;
  width: 16px; /* サイズ確認 */
  height: 16px; /* サイズ確認 */
}

/* 女優名とハートのコンテナ */
.cast-name {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  line-height: 1.2;
}

.actress-name {
  font-weight: bold;
  color: #333;
  font-size: 17px;
  line-height: 1.2;
}

/* ふりがな：少し小さく */
.cast-store {
  font-size: 0.85em;
  color: #666;
  margin: 2px 0;
}

.tag-button.active {
  color: #7b68ee;
}

.tag-button.active svg {
  stroke: #7b68ee;
}

.okini-button.active {
  color: #ff6b81;
}

.okini-button.active svg {
  stroke: #ff6b81;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 3px;
}

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

html {
  scrollbar-width: thin;
  scrollbar-color: #aaa #f1f1f1;
}

/* キャスト要素のハイライト効果 */
@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 107, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 129, 0);
  }
}

.highlighted-cast {
  animation: highlight-pulse 1s ease-out;
  border-radius: 8px;
}

/* アプリタイトル */
.app-title-link {
  text-decoration: none;
  display: block;
  cursor: pointer;
  padding: 0;
}

.app-title {
  width: auto;
  height: 45px;
  margin: 0;
  fill: #ff6b81;
  transition: fill 0.3s ease;
  display: block;
}

.app-title:hover {
  fill: #ff8a9a;
}

/* ヘッダーロゴの共通スタイル */
.header-app-title {
  width: auto;
  max-width: 200px; /* PCでの最大幅 */
  height: 35px; /* PCでの高さ */
  flex-shrink: 0;
  fill: #ff6b81;
}

/* タグ編集・削除画面用のロゴ */
.tag-header-logo {
  display: block;
  text-decoration: none;
  margin: 10px auto 20px;
  text-align: center;
}

.tag-header-app-title {
  width: auto;
  height: 35px;
  fill: #ff6b81;
  transition: fill 0.3s ease;
}

.tag-header-app-title:hover {
  fill: #ff8a9a;
}

/* メイン画面の女優カード詳細情報用スタイル */
.cast-kana {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 3px;
}

.cast-profile {
  font-size: 0.9em;
  color: #333;
  margin-bottom: 3px;
}

.cast-detail-info {
  font-size: 0.85em;
  color: #666;
  line-height: 1.3;
}

.detail-line {
  margin-bottom: 2px;
}

.detail-line:last-child {
  margin-bottom: 0;
}

/* カード全体の高さ調整 */
.cast-container {
  min-height: auto; /* 高さを内容に合わせる */
}

.cast-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.cast-info {
  flex: 1;
}

/* タグエリアの調整 */
.cast-bottom {
  margin-top: 5px;
}

.cast-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 1.05em;
  margin-top: 4px;
}

/* 長いテキストの省略処理 */
.actress-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.detail-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* タグエリアと作品エリアの独立表示 */
.cast-tags-area {
  margin: 3px 10px;
}

.cast-works-area {
  margin: 3px 10px;
}

.cast-tags-area + .cast-works-area {
  margin-top: 5px; /* タグがある場合は作品エリアとの間隔を調整 */
}

/* 並び替えモーダルのスタイル */
.sort-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.sort-option-button {
  width: 100%;
  padding: 15px 20px;
  border: 1px solid #eee;
  border-radius: 8px;
  background-color: white;
  font-size: 1em;
  color: #555;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sort-option-button:hover {
  background-color: #f8f9fa;
  border-color: #ff6b81;
}

.sort-option-button.active {
  background-color: #fff0f2;
  border-color: #ff6b81;
  color: #ff6b81;
  font-weight: bold;
}

.sort-check {
  color: #ff6b81;
  font-weight: bold;
  font-size: 1.2em;
}

#currentSortText {
  font-size: 1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* 並び替えボタン（検索・絞り込むと同じスタイル） */
.sort-button {
  display: flex;
  align-items: center;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  position: relative;
}

.sort-button svg {
  margin-right: 5px;
  width: 1.3em;
  height: 1.3em;
  stroke: #555555;
}

.sort-button p {
  color: #555555;
  margin: 0;
}

.sort-button.active {
  color: #ff6b81;
}

.sort-button.active svg {
  stroke: #ff6b81;
}

.sort-button.active p {
  color: #ff6b81;
}

/* 並び替えコンテナ */
.sort-select-container {
  position: relative;
  flex: 0 1 auto;
}

/* アコーディオン式並べ替えオプション */
.sort-accordion {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.sort-accordion.open {
  max-height: 80px;
  padding: 15px 10px;
}

.sort-options-row {
  display: flex;
  justify-content: space-between;
  gap: 6px; /* 8px から 6px に縮小 */
  margin: 0;
}

.sort-option-btn {
  flex: 1;
  padding: 8px 6px; /* 10px 8px から 8px 6px に縮小 */
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  font-size: 0.85em; /* 0.9em から 0.85em に縮小 */
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
  min-width: 0; /* 追加：flexアイテムの最小幅を0に */
}

.sort-option-btn:hover {
  background-color: #f0f0f0;
  border-color: #ff6b81;
}

.sort-option-btn.active {
  background-color: #ff6b81;
  color: white;
  border-color: #ff6b81;
  font-weight: bold;
}

/* ========== 作品を探すボタン・女優を探すボタン（ホバーエフェクト無し） ========== */
.works-search-button {
  display: flex;
  align-items: center;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.works-search-button svg {
  margin-right: 5px;
  width: 1.3em;
  height: 1.3em;
  fill: #ff6b81; /* 常時ピンク色 */
  stroke: none;
}

.works-search-button p {
  color: #ff6b81; /* 常時ピンク色 */
  margin: 0;
  font-size: 1em;
  font-weight: bold;
}

/* ホバー時：カーソル変化のみ（他のエフェクト無し） */
.works-search-button:hover {
  cursor: pointer;
  /* 背景色変更、transform、box-shadowは無し */
}

/* アクティブ時も最小限の効果のみ */
.works-search-button:active {
  /* 軽微なスケール変更のみ残す（オプション） */
  transform: scale(0.98);
}

/* モバイル表示の調整 */
@media (max-width: 480px) {
  .app-title {
    height: 35px;
  }

  .header-app-title {
    max-width: 160px; /* モバイルでの最大幅 */
    height: 30px; /* モバイルでの高さ */
  }

  .favorite-heart-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
  }

  .actress-name {
    font-size: 17px;
  }

  .sort-option-btn {
    font-size: 0.75em; /* モバイルではさらに小さく */
    padding: 8px 4px;
  }

  .sort-options-row {
    gap: 4px;
  }
}

/* PC表示用のメディアクエリ */
@media (min-width: 768px) {
  /* 🔄 以下の追加した修正を削除
  .main-header {
    position: relative;
    justify-content: center;
  }
  
  .app-title-link {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .header-buttons {
    position: absolute;
    right: 10px;
  }

  .username-link {
    max-width: 80px;
  }
  */

  /* 既存のPC版スタイルはそのまま維持 */
  body {
    background-color: #f5f5f5;
    padding: 0;
    margin: 0;
  }

  .sort-accordion {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  .sort-accordion.open {
    padding: 15px 20px; /* 左右のパディングを増やして中央寄せ */
  }

  .sort-options-row {
    gap: 4px; /* PC表示時はさらに gap を縮小 */
    max-width: 440px; /* 最大幅を制限 */
    margin: 0 auto; /* 中央寄せ */
  }

  .sort-option-btn {
    padding: 8px 4px; /* PC表示時はさらにパディングを縮小 */
    font-size: 0.8em; /* PC表示時はフォントサイズをさらに縮小 */
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .favorite-heart-icon {
    margin-right: 6px;
    margin-top: -2px;
    display: inline-block;
    flex-shrink: 0;
    width: 16px; /* サイズ確認 */
    height: 16px; /* サイズ確認 */
  }

  .shift-schedule {
    padding-right: 10px;
  }

  .work-item-placeholder {
    width: 55px;
    height: 78px;
  }

  .shift-schedule td {
    min-width: 59px;
    width: 59px;
  }

  .cast-tags .tag {
    font-size: 0.75em;
  }

  .main-header,
  #casts,
  #pagination,
  #pagination-info,
  .filter-container,
  .filter-header-row,
  .auth-container,
  .user-profile-container,
  .cast-detail-container,
  .tag-container {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    height: 100vh;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: -1;
  }

  /* 🔧 修正: PC版検索・絞り込みウィンドウを半透明背景＋左寄せ */
  .filter-window {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    z-index: 2000;
    justify-content: flex-start; /* 左寄せ */
  }

  .filter-window-container {
    background-color: white;
    max-width: 480px;
    width: 480px; /* 固定幅 */
    height: 100%;
    margin: 0; /* 中央寄せを削除 */
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    padding: 20px 20px 100px;
  }

  .filter-section {
    padding: 0 15px;
    margin-bottom: 35px;
  }

  .filter-select {
    width: 120px;
    padding: 12px 14px;
  }

  .filter-apply {
    position: fixed;
    left: 20px; /* 左端に固定 */
    transform: none; /* 中央寄せを削除 */
    max-width: 440px;
    width: 440px; /* 固定幅 */
    bottom: 20px;
  }

  .filter-apply.visible {
    opacity: 1;
    transform: none; /* 中央寄せを削除 */
    display: block;
  }

  /* PC版でのセレクトボックスのスタイル調整 */
  .filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 35px 12px 14px;
  }

  /* 🔧 修正: ホバー効果をグレーに統一 */
  .filter-select:hover {
    border-color: #bbb; /* ピンクからグレーに変更 */
  }

  .filter-header .close-button:hover,
  .filter-header .clear-button:hover {
    color: #ff6b81;
    transition: color 0.2s ease;
  }

  /* フィルターセクションのスペーシング調整 */
  .filter-section-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .filter-row {
    gap: 12px;
    margin-bottom: 15px;
  }

  /* 🔧 修正: PC版検索ウィンドウも半透明背景＋左寄せ */
  .search-window {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    z-index: 2000;
    justify-content: flex-start; /* 左寄せ */
  }

  .search-window-container {
    background-color: white;
    max-width: 480px;
    width: 480px; /* 固定幅 */
    height: 100%;
    overflow-y: auto;
    margin: 0; /* 中央寄せを削除 */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  }

  .modal.active {
    display: flex;
  }

  .modal-content {
    max-width: 480px;
    width: 90%;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
  }

  ::-webkit-scrollbar {
    width: 8px;
  }

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

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

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

  html {
    scrollbar-width: thin;
    scrollbar-color: #bbb #f1f1f1;
  }

  .today-option {
    margin-left: 15px;
  }

  .cast-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
  }

  .action-button:hover,
  .auth-button:hover,
  .profile-button:hover,
  .tag:hover {
    opacity: 0.9;
    transition: opacity 0.2s ease;
  }

  .shift-schedule {
    overflow-x: auto;
    scrollbar-width: thin;
    -ms-overflow-style: auto;
    margin-bottom: 10px;
    padding-bottom: 5px;
  }

  /* スクロールバーのスタイル調整 */
  .shift-schedule::-webkit-scrollbar {
    height: 4px;
  }

  .shift-schedule::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
  }

  .shift-schedule::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
  }

  .shift-schedule::-webkit-scrollbar-thumb:hover {
    background: #aaa;
  }

  .shift-schedule td {
    min-width: 75px;
    padding: 3px;
  }

  .shift-box {
    min-height: 55px;
    min-width: 70px;
  }

  #areaSelectModal.modal,
  #prefectureSelectModal.modal {
    display: none;
    position: fixed;
    top: 20%;
    left: 20px;
    transform: translateY(0);
    width: 370px;
    height: auto;
    max-height: 80vh;
    background-color: white;
    z-index: 3000;
    border-radius: 8px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
  }

  #areaSelectModal.modal.active,
  #prefectureSelectModal.modal.active {
    display: block;
  }

  #areaSelectModal .modal-header,
  #prefectureSelectModal .modal-header {
    width: 100%;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #ff6b81;
    border-radius: 8px 8px 0 0;
  }

  #areaSelectModal .modal-content,
  #prefectureSelectModal .modal-content {
    width: 100%;
    height: auto;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    padding: 15px;
    background-color: white;
  }

  #areaSelectModal .area-button,
  #prefectureSelectModal .prefecture-button {
    width: 100%;
    text-align: center;
    padding: 20px 15px;
    margin-bottom: 5px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: white;
    font-size: 1em;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  #areaSelectModal .area-button:hover,
  #prefectureSelectModal .prefecture-button:hover {
    background-color: #f5f5f5;
    border-color: #ff6b81;
  }

  #prefectureSelectModal .back-button {
    position: absolute;
    left: 15px;
    top: 15px;
    transform: none;
    background: none;
    border: 1px solid white;
    color: white;
    padding: 6px 10px;
    font-size: 0.9em;
    cursor: pointer;
  }

  .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 280px;
    width: calc(100% - 280px);
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2999;
  }

  .modal-overlay.active {
    display: block;
  }

  #prefectureSelectModal {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  #prefectureSelectModal.active {
    transform: translateX(0);
  }

  /* PC表示用：ホバーエフェクト無し */
  .works-search-button:hover {
    cursor: pointer;
  }
}

/* タブレット表示の調整 */
@media (min-width: 481px) and (max-width: 767px) {
  body {
    background-color: #f9f9f9;
  }

  .main-header,
  #casts,
  #pagination,
  #pagination-info,
  .filter-container,
  .filter-header-row,
  .auth-container,
  .user-profile-container,
  .cast-detail-container,
  .tag-container {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .filter-window-container,
  .search-window-container,
  .modal-content {
    max-width: 90%;
    margin: 0 auto;
  }

  .filter-window-container {
    padding: 25px 25px 120px;
  }

  .filter-select {
    width: 115px;
    padding: 11px 13px;
  }

  .filter-apply {
    max-width: calc(90% - 40px);
  }
}
