:root {
  color-scheme: light;
  --bg: #eefbfc;
  --surface: #ffffff;
  --surface-soft: #e5f7f8;
  --ink: #101846;
  --muted: #586174;
  --line: #c5e2e6;
  --accent: #252b7f;
  --accent-deep: #070d3d;
  --aqua: #92edf1;
  --warn: #c62b24;
  --mark: #f2cf53;
  --shadow: 0 10px 22px rgba(7, 13, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: relative;
  overflow: hidden;
  min-height: clamp(88px, 16.67vw, 250px);
  background: #8ff2f2 url("./assets/site-header.png") center center / cover no-repeat;
  border-bottom: 4px solid var(--accent-deep);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notice-bar span,
.tag,
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  padding: 3px 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.notice-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff8d7;
  border-bottom: 1px solid #dfca77;
}

.notice-bar span:first-child {
  background: var(--warn);
  color: #fff;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.search-band {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bac8c7;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 43, 127, 0.16);
}

.clear-button,
.ghost-button {
  min-height: 42px;
  border: 1px solid #bac8c7;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--accent-deep);
  font-weight: 700;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tab-button {
  min-height: 38px;
  border: 1px solid #bac8c7;
  border-radius: 8px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.tab-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.summary-text,
.data-source-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.series-view {
  margin-bottom: 18px;
}

.series-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.series-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.series-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.series-button {
  display: grid;
  gap: 5px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.series-button.is-selected {
  border-color: var(--accent);
  background: #e9fbff;
}

.series-name {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.series-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.item-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.item-image-wrap {
  display: block;
  aspect-ratio: 4 / 3;
  background: #dff7f8;
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.item-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.item-title {
  display: -webkit-box;
  min-height: 3.15em;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  background: #e9f4fb;
  color: #202a64;
  font-weight: 700;
}

.tag {
  background: #fff0a9;
  color: #564400;
}

.review-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.item-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.item-link:hover,
.item-link:focus-visible,
.tab-button:hover,
.clear-button:hover,
.ghost-button:hover,
.series-button:hover {
  filter: brightness(0.96);
}

.empty-state {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 16px 28px;
  background: var(--accent-deep);
  color: #e8eeee;
  font-size: 0.84rem;
  text-align: center;
}

.site-footer p {
  margin: 6px auto;
  max-width: 880px;
}

@media (max-width: 720px) {
  .search-row {
    grid-template-columns: 1fr;
  }

  .clear-button {
    width: 100%;
  }

  .result-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .items-grid {
    grid-template-columns: 1fr;
  }
}
