@charset "UTF-8";
:root {
  --app-safe-area-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --app-safe-area-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --app-safe-area-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --app-safe-area-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
}
* {
  box-sizing: border-box;
}
html:has(body.dictionary-body) {
  background-color: rgb(241, 241, 241);
}

body.dictionary-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + var(--app-safe-area-top))
    var(--app-safe-area-right)
    calc(24px + var(--app-safe-area-bottom))
    var(--app-safe-area-left);
  background-color: rgb(241, 241, 241);
  color: #4b3a2b;
  font-family: -apple-system, sans-serif;
  user-select: text;
  -webkit-user-select: text;
  -webkit-tap-highlight-color: transparent;
}

.back-button {
  cursor: url('/images/ui/pointer.png'), auto;
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 38px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid #89c5e5;
  border-radius: 10px;
  background-color: white;
  color: #51b8f0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  line-height: 1;
  box-shadow: 1px 2px 2px transparent;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

@media (hover: hover) {
  .back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #f0f8ff;
  }
}

.dictionary-page {
  position: relative;
  width: min(calc(100vw - 20px - var(--app-safe-area-left) - var(--app-safe-area-right)), 550px);
  height: min(calc(100dvh - 48px - var(--app-safe-area-top) - var(--app-safe-area-bottom)), 700px);
  min-height: 0;
  margin: 0 auto;
  padding: 15px 10px;
  background-color: #f0fbff;
  box-shadow: 0 0 10px rgba(137, 197, 229, 0.18);
  overflow-x: hidden;
  overflow-y: auto;
}

.dictionary-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  text-align: center;
}

.dictionary-hero-text {
  display: flex;
  justify-content: center;
}

.dictionary-title {
  margin: 0;
  line-height: 0;
}

.dictionary-title-image {
  display: block;
  width: min(78vw, 300px);
  height: auto;
}

.dictionary-talk {
  width: min(100%, 460px);
}

.dictionary-lead {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(137, 197, 229, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #5b4634;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 3px 10px rgba(137, 197, 229, 0.12);
}

.dictionary-controls {
  display: grid;
  gap: 0;
  width: min(100%, 500px);
  margin: 0 auto;
  padding: 14px 0 3px;
}

.dictionary-search-label {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.dictionary-search-text {
  width: fit-content;
  margin: 0 auto;
  padding: 3px 8px;
  border: 1px solid darkgray;
  border-radius: 6px;
  background-color: white;
  color: #6a4a32;
  font-size: 13px;
  font-weight: 800;
}

.dictionary-search-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid #8ccbed;
  border-radius: 12px;
  background-color: white;
  color: #5a3f28;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  outline: none;
  text-align: center;
  box-shadow: 0 0 5px rgba(135, 206, 235, 0.5);
}

.dictionary-search-input::placeholder {
  color: #a6c7d8;
}

.dictionary-search-input:focus {
  border: 3px solid #8ccbed;
  box-shadow: 0 0 5px rgba(135, 206, 235, 0.5);
}

.dictionary-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.dictionary-filter-button {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #89c5e5;
  border-radius: 999px;
  background-color: #f5fbff;
  color: #3695c9;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: url('/images/ui/pointer.png'), auto;
  box-shadow: 0 2px 7px rgba(81, 184, 240, 0.18);
}

.dictionary-filter-button[aria-pressed="true"] {
  border-color: #51b8f0;
  background-color: rgb(255, 255, 223);
  color: #2c98cf;
  box-shadow: 0 0 8px rgba(81, 184, 240, 0.32);
}

.dictionary-summary {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
  padding: 0 2px;
}

.dictionary-result-count {
  flex: 0 0 auto;
  margin: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background-color: #eef9ff;
  color: #3695c9;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dictionary-word-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: min(100%, 500px);
  margin: 0 auto;
  align-items: start;
}

.dictionary-word-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid #d7edf8;
  border-radius: 12px;
  background-color: white;
  box-shadow: 0 2px 8px rgba(137, 197, 229, 0.13);
}

.dictionary-word-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dictionary-word {
  margin: 0;
  color: #5a3f28;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dictionary-meaning-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 1.3em;
  color: #5b4634;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.dictionary-course-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dictionary-course-chip {
  padding: 3px 7px;
  border: 1px solid #d5dde4;
  border-radius: 999px;
  background-color: #f8fdff;
  color: #73563d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.dictionary-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px 16px;
  border: 2px solid #e1e5e7;
  border-radius: 12px;
  background-color: white;
  color: #5b4634;
  font-weight: 700;
  text-align: center;
  line-height: 1.7;
}

.dictionary-load-status {
  width: fit-content;
  margin: 16px auto 0;
  padding: 8px 14px;
  border: 1px solid #89c5e5;
  border-radius: 999px;
  background-color: #f5fbff;
  color: #3695c9;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 2px 7px rgba(81, 184, 240, 0.18);
}

.dictionary-load-status[hidden] {
  display: none;
}

@media (max-width: 640px) {
  html:has(body.dictionary-body) {
    background-color: white;
  }

  body.dictionary-body {
    display: block;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    background-color: white;
  }

  .dictionary-page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding:
      calc(15px + var(--app-safe-area-top))
      calc(10px + var(--app-safe-area-right))
      calc(15px + var(--app-safe-area-bottom))
      calc(10px + var(--app-safe-area-left));
    box-shadow: none;
  }

  .dictionary-lead {
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13px;
  }

  .dictionary-summary {
    align-items: center;
  }

  .dictionary-word-card {
    padding: 10px;
  }

  .dictionary-word {
    font-size: 17px;
  }
}

.dictionary-word-card {
  position: relative;
}

.dictionary-scroll-top-button {
  position: sticky;
  top: 8px;
  z-index: 190;
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 2px -42px auto;
  padding: 0;
  place-items: center;
  border: 1px solid #89c5e5;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.94);
  color: #51b8f0;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: url('/images/ui/pointer.png'), auto;
  box-shadow: 1px 2px 6px rgba(54, 149, 201, 0.28);
}

.dictionary-scroll-top-button[hidden] {
  display: none;
}

.dictionary-scroll-top-button:focus-visible {
  outline: 3px solid rgba(255, 173, 72, 0.85);
  outline-offset: 2px;
}

.dictionary-scroll-top-button:active {
  transform: translateY(1px);
}

.dictionary-word-card:has(.dictionary-word-link) {
  cursor: url('/images/ui/pointer.png'), auto;
}

.dictionary-word-link {
  cursor: text;
  color: inherit;
  text-decoration: none;
}

.dictionary-card-text {
  cursor: text;
}

.dictionary-word-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.dictionary-word-link:focus-visible {
  outline: 3px solid rgba(255, 173, 72, 0.85);
  outline-offset: 5px;
  border-radius: 8px;
}

.dictionary-word-page {
  display: grid;
  align-content: start;
  gap: 14px;
}

.dictionary-word-page .dictionary-word-card {
  gap: 12px;
  padding: 18px 16px;
}

.dictionary-word-page .dictionary-word-header {
  justify-content: flex-start;
  padding-bottom: 4px;
  border-bottom: 1px solid #edf6fb;
}

.dictionary-word-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dictionary-home-logo {
  display: block;
  width: 86px;
  border-radius: 8px;
}

.dictionary-home-logo:focus-visible {
  outline: 3px solid rgba(255, 173, 72, 0.85);
  outline-offset: 3px;
}

.dictionary-home-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.dictionary-word-page .dictionary-word {
  font-size: 28px;
  letter-spacing: 0;
}

.dictionary-section-title {
  margin: 8px 0 -4px;
  color: #3695c9;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
}

.dictionary-word-page .dictionary-meaning-list {
  padding: 12px 14px 12px 2em;
  border: 1px solid #e4f3fb;
  border-radius: 10px;
  background-color: #f8fdff;
  font-size: 16px;
}

.dictionary-relations {
  display: grid;
  gap: 10px;
}

.dictionary-relations-layout {
  position: relative;
}

.dictionary-relations-layout .dictionary-related-word-group:first-child .dictionary-related-word-item:first-child {
  min-height: 78px;
  padding-right: 104px;
}

.dictionary-relations-layout .dictionary-character {
  position: absolute;
  right: 4px;
  top: -4px;
  z-index: 1;
  min-height: 0;
  margin: 0;
}

.dictionary-related-word-group {
  display: grid;
  gap: 6px;
}

.dictionary-related-word-title {
  width: fit-content;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  color: #73563d;
  background-color: #fff7df;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.dictionary-related-word-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dictionary-related-word-item {
  padding: 10px 12px;
  border: 1px solid #e4f3fb;
  border-radius: 10px;
  background-color: #f8fdff;
}

.dictionary-related-word-link {
  color: #3695c9;
  font-size: 17px;
  font-weight: 900;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.dictionary-related-word-link:focus-visible {
  outline: 3px solid rgba(255, 173, 72, 0.85);
  outline-offset: 3px;
  border-radius: 4px;
}

.dictionary-related-word-meaning {
  margin: 5px 0 0;
  color: #667a85;
  font-size: 14px;
  line-height: 1.6;
}

.dictionary-example-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: dictionary-example;
}

.dictionary-example-item {
  position: relative;
  padding: 12px 14px 12px 42px;
  border: 1px solid #e4f3fb;
  border-radius: 10px;
  background-color: #fff;
  counter-increment: dictionary-example;
}

.dictionary-example-item::before {
  content: counter(dictionary-example);
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background-color: #3695c9;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.dictionary-example-sentence,
.dictionary-example-translation {
  margin: 0;
}

.dictionary-example-sentence-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.dictionary-example-sentence {
  flex: 1;
  color: #273f4d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.dictionary-example-speech-button {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 5px;
  place-items: center;
  border: 1px solid #b9deef;
  border-radius: 50%;
  color: #3695c9;
  background-color: #f2fbff;
  cursor: pointer;
}

.dictionary-example-speech-button:hover,
.dictionary-example-speech-button.is-speaking {
  color: #fff;
  background-color: #3695c9;
}

.dictionary-example-speech-button:focus-visible {
  outline: 3px solid rgba(255, 173, 72, 0.85);
  outline-offset: 2px;
}

.dictionary-example-speech-button svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dictionary-example-translation {
  margin-top: 3px;
  color: #667a85;
  font-size: 14px;
  line-height: 1.6;
}

.dictionary-character {
  display: flex;
  min-height: 72px;
  align-items: end;
  justify-content: flex-end;
  margin: -2px 4px -10px 0;
  pointer-events: none;
}

.dictionary-character img {
  display: block;
  width: auto;
  max-width: 88px;
  height: auto;
  max-height: 92px;
  object-fit: contain;
  object-position: right bottom;
}

.dictionary-word-page .dictionary-course-list {
  gap: 8px;
}

.dictionary-word-page .dictionary-course-chip {
  padding: 6px 10px;
  font-size: 13px;
}

.dictionary-word-page .dictionary-back-button {
  position: static;
  text-decoration: none;
}

.dictionary-course-link {
  color: inherit;
  text-decoration: none;
}

.dictionary-copyright {
  padding: 4px 0 2px;
  color: #78909c;
  font-size: 12px;
  text-align: center;
}

.dictionary-copyright a {
  color: inherit;
  text-decoration: none;
}

.dictionary-copyright a:hover {
  color: #3695c9;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dictionary-copyright a:focus-visible {
  outline: 3px solid rgba(255, 173, 72, 0.85);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .dictionary-word-page .dictionary-word {
    font-size: 24px;
  }

  .dictionary-word-page .dictionary-word-card {
    padding: 16px 14px;
  }

  .dictionary-character img {
    max-width: 76px;
    max-height: 80px;
  }

  .dictionary-relations-layout .dictionary-related-word-group:first-child .dictionary-related-word-item:first-child {
    min-height: 70px;
    padding-right: 88px;
  }

  .dictionary-home-logo {
    width: 72px;
  }
}
@import url("/css/page-transition.css");
