body.app-base-body {
  overflow: hidden;
}

.app-base-page * {
  box-sizing: border-box;
}

.app-base-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
}

.app-base-page .container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  max-width: none;
  width: 100%;
  padding: 0;
}

@media screen and (max-width: 1020px) {
  .app-base-page .container {
    height: calc(100vh - 52px);
  }
}

.header {
  background: #2c3e50;
  color: white;
  padding: 6px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* サイバー境界線 */
.main::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: #fff;
  transform: translateX(-50%);
  z-index: 20;
}

.editor-panel {
  width: 50%;
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  background: #181c20;
  border-right: 2px solid #222;
  overflow: hidden;
  position: relative;
}

.code-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  background: #181c20;
}

.editor-header {
  background: #23272e;
  color: #00ffe7;
  padding: 7px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  border-bottom: 1px solid #fff;
}

.editor-title {
  font-size: 14px;
  font-weight: 700;
  color: #00ffe7;
}

.editor-controls {
  display: flex;
  gap: 8px;
}

.editor-wrapper {
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.line-numbers {
  width: 50px;
  flex-shrink: 0;
  padding: 15px 10px;
  background: #23272e;
  border-right: 1px solid #222;
  color: #3fffd7;
  font-family: 'Fira Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  overflow-y: hidden;
  overflow-x: hidden;
  white-space: pre;
}

.code-editor {
  flex: 1 1 0%;
  min-width: 0;
  padding: 15px;
  font-family: 'Fira Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
  border: none;
  resize: none;
  outline: none;
  background: #181c20;
  color: #b8ffe7;
  overflow-y: auto;
}

.resize-handle {
  height: 8px;
  background: #ddd;
  cursor: ns-resize;
  position: relative;
  z-index: 10;
}

.resize-handle:hover {
  background: #bbb;
}

.resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 3px;
  background: #999;
  border-radius: 2px;
}

.files-section {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  overflow: hidden;
}

.cyber-divider {
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #00ffe7 50%, transparent 100%);
  box-shadow:
    0 0 8px #00ffe7,
    0 0 4px #00bfff;
  flex-shrink: 0;
}

.files-header {
  background: #23272e;
  color: #00ffe7;
  padding: 7px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #fff;
}

.files-title {
  font-size: 14px;
  font-weight: 700;
  color: #00ffe7;
}

.files-panel {
  flex: 1 1 0%;
  min-height: 0;
  padding: 15px;
  overflow-y: auto;
  background: #0a0e12;
}

/* サイバー共通ボタン */
.app-base-page .btn,
.app-base-page .btn-modal,
.app-base-page .file-delete,
.app-base-page .version-delete,
.app-base-page .btn-download,
.app-base-page .btn-fullscreen {
  background: transparent;
  color: #00ffe7;
  border: 1px solid #00ffe7;
  border-radius: 6px;
  font-family: 'M PLUS Rounded 1c', 'Fira Mono', monospace;
  font-size: 16px;
  font-weight: bold;
  padding: 8px 16px;
  margin: 2px 4px;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
  box-shadow: none;
  text-decoration: none;
  min-height: unset;
  height: unset;
  line-height: normal;
  animation: none;
}
.app-base-page .btn:hover,
.app-base-page .btn-modal:hover,
.app-base-page .file-delete:hover,
.app-base-page .version-delete:hover,
.app-base-page .btn-download:hover,
.app-base-page .btn-fullscreen:hover {
  background: rgba(0, 255, 231, 0.1);
  transform: translateY(-2px);
}
.app-base-page .btn:active,
.app-base-page .btn-modal:active,
.app-base-page .file-delete:active,
.app-base-page .version-delete:active,
.app-base-page .btn-download:active,
.app-base-page .btn-fullscreen:active {
  transform: translateY(0);
}
/* バリエーション */
.btn-save {
  border-color: #00ffe7 !important;
  color: #00ffe7 !important;
  background: transparent !important;
}
.btn-save:hover {
  background: rgba(0, 255, 231, 0.1) !important;
}
.btn-copy {
  border-color: #2ecc71 !important;
  color: #2ecc71 !important;
  background: transparent !important;
}
.btn-copy:hover {
  background: rgba(46, 204, 113, 0.1) !important;
}
.btn-clear {
  border-color: #e74c3c !important;
  color: #e74c3c !important;
  background: transparent !important;
}
.btn-clear:hover {
  background: rgba(231, 76, 60, 0.1) !important;
}
.btn-download {
  border-color: #3498db !important;
  color: #3498db !important;
  background: transparent !important;
}
.btn-download:hover {
  background: rgba(52, 152, 219, 0.1) !important;
}
.btn-import {
  border-color: #27ae60 !important;
  color: #27ae60 !important;
  background: transparent !important;
}
.btn-import:hover {
  background: rgba(39, 174, 96, 0.1) !important;
}
.btn-fullscreen {
  border-color: #9b59b6 !important;
  color: #9b59b6 !important;
  background: transparent !important;
}
.btn-fullscreen:hover {
  background: rgba(155, 89, 182, 0.1) !important;
}
.btn-modal-cancel {
  border-color: #95a5a6 !important;
  color: #95a5a6 !important;
  background: transparent !important;
}
.btn-modal-cancel:hover {
  background: rgba(149, 165, 166, 0.1) !important;
}
.btn-modal-ok {
  border-color: #00ffe7 !important;
  color: #00ffe7 !important;
  background: transparent !important;
}
.btn-modal-ok:hover {
  background: rgba(0, 255, 231, 0.1) !important;
}
.file-delete,
.version-delete {
  border-color: #e74c3c !important;
  color: #e74c3c !important;
  background: transparent !important;
  font-size: 14px;
  padding: 6px 12px;
}
.file-delete:hover,
.version-delete:hover {
  background: rgba(231, 76, 60, 0.1) !important;
}

.file-upload-area {
  border: 2px dashed #00ffe7;
  background: rgba(10, 14, 18, 0.8);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 15px;
  transition: all 0.3s;
  cursor: pointer;
}

.file-upload-area.dragover {
  border-color: #0fffc1;
  background: rgba(0, 255, 231, 0.15);
  transform: scale(1.02);
}

.file-upload-area:hover {
  border-color: #0fffc1;
  background: rgba(0, 255, 231, 0.12);
  transform: scale(1.01);
  box-shadow: 0 0 15px rgba(0, 255, 231, 0.3);
}

.upload-icon {
  font-size: 36px;
  margin-bottom: 8px;
  color: #00ffe7;
}

.upload-text {
  color: #00ffe7;
  font-size: 12px;
  font-weight: 500;
}

.upload-subtext {
  color: #7dd3c0;
  font-size: 12px;
  margin-top: 8px;
}

.app-base-page .file-input {
  display: none;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  border: none;
  border-radius: 8px;
  padding: 15px;
  min-height: 100px;
}

.file-item {
  background: #181c20;
  border: 1px solid #00ffe7;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}

.file-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 255, 231, 0.3);
  border-color: #0fffc1;
}

.file-thumbnail {
  width: 80px;
  height: 80px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #23272e;
  border-radius: 4px;
  overflow: hidden;
}

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

.file-icon {
  font-size: 40px;
  color: #00ffe7;
}

.file-name {
  font-size: 11px;
  color: #fff;
  word-break: break-all;
  margin-bottom: 8px;
  font-weight: 500;
}

.file-delete {
  background: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.file-delete:hover {
  background: rgba(231, 76, 60, 0.2);
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.versions-panel {
  background: transparent;
  border-radius: 8px;
  color: #00ffe7;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 20px;
}

.versions-title {
  font-size: 11px;
  font-weight: 600;
  color: #fff9c4;
  margin-bottom: 8px;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ヘッダーのボタンコンテナ */
.header-buttons {
  display: flex;
  gap: 10px;
}

/* ファイルアップロードとインフォのコンテナ */
.upload-info-container {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.upload-info-container > .file-upload-area {
  flex: 1;
  margin-bottom: 0;
}

/* 音声ファイル注意書きボックス */
.audio-info-box {
  background: rgba(10, 14, 18, 0.8);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: #aaaaaa;
  flex: 1;
}

.audio-info-title {
  font-weight: 600;
  margin-bottom: 5px;
  color: #fff9c4;
}

.audio-info-note {
  font-size: 11px;
  margin-top: 5px;
}

/* プロンプトモーダルのサイズ */
.prompt-modal-content {
  max-width: 500px;
}

/* バージョンモーダルメッセージ */
.version-modal-message {
  margin-bottom: 20px;
  color: #95a5a6;
  font-size: 14px;
  text-align: center;
}

.version-item {
  background: #23272e;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
  color: #00ffe7;
}

.version-item:hover {
  background: #2c3440;
}

.version-time {
  color: #ffffff;
}

.version-delete {
  background: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

.version-delete:hover {
  background: rgba(231, 76, 60, 0.1);
}

.preview-panel {
  width: 50%;
  display: flex;
  flex-direction: column;
  background: white;
}

.preview-header {
  background: #23272e;
  color: #00ffe7;
  padding: 7px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #fff;
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
}

.btn-fullscreen {
  background: #9b59b6;
  color: white;
}

.btn-fullscreen:hover {
  background: #8e44ad;
}

.editor-panel.hidden {
  display: none;
}

/* 全画面時は縦線を非表示 */
.main:has(.editor-panel.hidden)::before {
  display: none;
}

.preview-panel.fullscreen {
  width: 100%;
}

.preview-frame {
  flex: 1;
  border: none;
  background: white;
}

.app-base-page .app-base-footer {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 0 16px;
  font-size: 11px;
  color: #2d3d4a;
  background: #0a0e12;
  border-top: 1px solid #1a2332;
  flex-shrink: 0;
}

.app-base-page .app-base-footer-copy {
  color: #2d3d4a;
}

.app-base-page .app-base-footer-nav {
  display: flex;
  gap: 16px;
}

.app-base-page .app-base-footer-nav a {
  color: #3a5060;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s;
}

.app-base-page .app-base-footer-nav a:hover {
  color: #3fffd7;
}

#toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #2ecc71;
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
  width: auto;
  height: auto;
  align-items: unset;
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
}

.app-base-page .modal {
  display: none;
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.app-base-page .modal.show {
  display: flex;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  background: #23272e;
  padding: 30px;
  border-radius: 8px;
  border: 2px solid #00ffe7;
  box-shadow:
    0 0 20px rgba(0, 255, 231, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #00ffe7;
}

.filename-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-input {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #00ffe7;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 0;
  outline: none;
  background: #181c20;
  color: #fff;
  font-family: 'M PLUS Rounded 1c', 'Fira Mono', monospace;
  transition: all 0.3s;
}

.file-extension {
  font-size: 16px;
  font-weight: 600;
  color: #00ffe7;
  white-space: nowrap;
  font-family: 'M PLUS Rounded 1c', 'Fira Mono', monospace;
}

.modal-input::placeholder {
  color: rgba(0, 255, 231, 0.5);
}

.modal-input:focus {
  border-color: #0fffc1;
  box-shadow: 0 0 10px rgba(0, 255, 231, 0.4);
  background: #1f2329;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-modal {
  padding: 8px 20px;
  border: 1px solid;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  transition: all 0.3s;
}

.btn-modal-cancel {
  border-color: #95a5a6 !important;
  color: #95a5a6 !important;
  background: transparent !important;
}

.btn-modal-cancel:hover {
  background: rgba(149, 165, 166, 0.1) !important;
}

.btn-modal-ok {
  border-color: #00ffe7 !important;
  color: #00ffe7 !important;
  background: transparent !important;
}

.btn-modal-ok:hover {
  background: rgba(0, 255, 231, 0.1) !important;
}

/* プロンプトモーダル専用スタイル */
.prompt-file-preview {
  margin-bottom: 10px;
}

.prompt-file-preview img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 4px;
}

.prompt-file-preview-icon {
  font-size: 40px;
  color: #00ffe7;
}

.prompt-file-preview-doc {
  font-size: 40px;
}

.prompt-file-name {
  font-weight: 600;
  color: #00ffe7;
}

/* バージョンリスト表示 */
.version-list-empty {
  color: #7f8c8d;
  font-size: 12px;
}

.version-loaded-message {
  color: #00ffe7;
  font-weight: 600;
}

/* ファイルアイテム内の要素 */
.file-item-clickable {
  cursor: pointer;
}

.prompt-purpose-label {
  margin-bottom: 10px;
  font-size: 13px;
  color: #95a5a6;
}

/* promptPurposeの下のマージンを追加 */
#promptPurpose {
  margin-bottom: 15px;
}

.prompt-preview-box {
  background: #181c20;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #00ffe7;
  margin-bottom: 15px;
  font-size: 12px;
  color: #95a5a6;
  max-height: 150px;
  overflow-y: auto;
}

/* prompt-preview-box用のスクロールバー */
.prompt-preview-box::-webkit-scrollbar {
  width: 8px;
  background: #181c20;
}

.prompt-preview-box::-webkit-scrollbar-thumb {
  background: #00ffe7;
  border-radius: 4px;
  box-shadow: 0 0 6px #00ffe7;
}

.prompt-preview-box {
  scrollbar-color: #00ffe7 #181c20; /* Firefox用 */
  scrollbar-width: thin;
}

.prompt-preview-title {
  font-weight: 600;
  margin-bottom: 5px;
  color: #00ffe7;
}

.prompt-preview-content {
  white-space: pre-wrap;
  color: #fff;
}

.prompt-modal-center {
  margin-bottom: 15px;
  text-align: center;
}

/* サイバー風スクロールバー */
.editor-panel ::-webkit-scrollbar,
.files-panel ::-webkit-scrollbar {
  width: 8px;
  background: #181c20;
}
.editor-panel ::-webkit-scrollbar-thumb,
.files-panel ::-webkit-scrollbar-thumb {
  background: #00ffe7;
  border-radius: 4px;
  box-shadow: 0 0 6px #00ffe7;
}
.editor-panel,
.files-panel {
  scrollbar-color: #00ffe7 #181c20; /* Firefox用 */
  scrollbar-width: thin;
}
