:root {
  --enh-blue-1: #0f2f5d;
  --enh-blue-2: #1f5ca8;
  --enh-blue-3: #6cb7ff;
  --enh-panel: #f6f9ff;
  --enh-text: #102542;
  --enh-shadow-3d: 0 16px 34px rgba(6, 35, 77, 0.26), 0 5px 10px rgba(3, 22, 51, 0.24);
  --enh-side-panel-width: min(540px, 42vw);
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 0%, rgba(108, 183, 255, 0.18) 0%, rgba(108, 183, 255, 0) 35%),
    linear-gradient(180deg, #f7fbff 0%, #f4f8ff 100%);
  transition: padding-right 0.22s ease;
}

body.enh-panel-open {
  padding-right: var(--enh-side-panel-width);
}

main,
.chat-container {
  flex: 1;
}

header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(340deg, rgba(108, 183, 255, 0.26) 0%, rgba(108, 183, 255, 0) 35%);
}

header h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  text-shadow: 0 3px 10px rgba(2, 17, 41, 0.46);
}

header p {
  position: relative;
  z-index: 1;
}

.header-title-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer;
}

.header-title-link:hover {
  filter: brightness(1.08);
}

.header-actions {
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.video-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f2f8ff;
  font-size: 0.85rem;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.video-shortcut:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.enh-video-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--enh-side-panel-width);
  display: none;
  z-index: 9999;
  pointer-events: none;
}

.enh-video-overlay.open {
  display: block;
}

.enh-video-panel {
  width: 100%;
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: -22px 0 46px rgba(2, 10, 24, 0.45), inset 2px 0 0 rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(160deg, rgba(126, 185, 255, 0.1) 0%, rgba(126, 185, 255, 0) 35%),
    linear-gradient(180deg, #0e2649 0%, #091b34 100%);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.enh-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  color: #e7efff;
  background: linear-gradient(120deg, #0f2c52 0%, #1a477d 100%);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.enh-video-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.enh-video-open-link {
  color: #d6e7ff;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(214, 231, 255, 0.45);
}

.enh-video-open-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
}

.enh-video-open-link.is-hidden {
  display: none;
}

.enh-video-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.enh-video-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.enh-video-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: #071b34;
  height: 100%;
  overflow: auto;
}

.enh-video-list {
  display: grid;
  gap: 8px;
}

.enh-video-content {
  background: #071b34;
  border-radius: 10px;
}

.enh-video-option {
  width: 100%;
  border: 1px solid #295892;
  background: #0f2c52;
  color: #dce9ff;
  border-radius: 10px;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.88rem;
}

.enh-video-option.active,
.enh-video-option:hover {
  background: #1a477d;
  border-color: #5f95d8;
  color: #fff;
}

.enh-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
  background: #000;
  border-radius: 10px;
}

.enh-guide-text {
  padding: 14px;
  color: #dce9ff;
}

.enh-guide-text h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #ffffff;
}

.enh-guide-text p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.enh-guide-text p:last-child {
  margin-bottom: 0;
}

.enh-guide-image {
  margin: 0;
}

.enh-guide-image img {
  display: block;
  width: 100%;
  border-radius: 10px;
}

.enh-guide-image figcaption {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #c4d9fb;
  padding: 8px 6px 2px;
}

body:not(.is-index) header {
  background: linear-gradient(145deg, var(--enh-blue-1), var(--enh-blue-2)) !important;
  padding: 24px 16px 20px !important;
  box-shadow: var(--enh-shadow-3d) !important;
}

body:not(.is-index) header h1 {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem) !important;
}

body:not(.is-index) header p {
  font-size: 0.95rem !important;
  margin-top: 6px !important;
  margin-bottom: 0 !important;
  opacity: 0.95 !important;
}

body.is-index header {
  background:
    radial-gradient(circle at 85% 10%, rgba(117, 186, 255, 0.32) 0%, rgba(117, 186, 255, 0) 35%),
    linear-gradient(135deg, #0b2f63 0%, #215eb0 58%, #2a76d9 100%) !important;
  padding: 34px 20px 27px !important;
  box-shadow: 0 20px 40px rgba(6, 34, 77, 0.34), 0 5px 14px rgba(2, 16, 41, 0.26) !important;
}

body.is-index header h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.8rem) !important;
  letter-spacing: -0.015em;
}

body.is-index header p {
  font-size: clamp(1rem, 1.9vw, 1.15rem) !important;
}

footer {
  margin-top: auto !important;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #0c2c57 0%, #15437f 100%) !important;
  box-shadow: 0 -10px 22px rgba(8, 34, 68, 0.32), inset 0 2px 0 rgba(255, 255, 255, 0.12);
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 46%);
}

footer * {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  :root {
    --enh-side-panel-width: 100vw;
  }

  body.enh-panel-open {
    padding-right: 0;
  }

  body:not(.is-index) header {
    padding: 18px 14px 16px !important;
  }

  .video-shortcut {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .enh-video-panel {
    width: 100%;
    max-height: 100vh;
  }
}
