:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6f8fd;
  --text: #1c2430;
  --card-bg: #ffffff;
  --card-border: #2a34421f;
  --card-shadow: 0 2px 10px #0a13200f;
  --input-bg: #ffffff;
  --input-border: #2a344247;
  --button-bg: #e9eef8;
  --button-text: #1c2430;
  --divider: #2a344224;
  --muted: 0.74;
  --link: #2e5bb8;
  --history-chip-bg: #ffffffcc;
  --history-chip-border: #2a34424d;
  --code-bg: #f8f9fc;
}

html[data-theme='light'] {
  color-scheme: light;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121722;
  --text: #e5eaf2;
  --card-bg: #1a2130;
  --card-border: #c8d4e01f;
  --card-shadow: 0 2px 12px #00000052;
  --input-bg: #111826;
  --input-border: #c8d4e036;
  --button-bg: #2a3347;
  --button-text: #e5eaf2;
  --divider: #c8d4e021;
  --muted: 0.82;
  --link: #8fb2ff;
  --history-chip-bg: #1e2636d9;
  --history-chip-border: #c8d4e047;
  --code-bg: #121926;
}

body {
  margin: 0;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--link);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.page-header {
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2rem);
  letter-spacing: -0.02em;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.subtitle {
  margin: 8px 0 0;
  opacity: 0.78;
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.home-search {
  margin: 10px 0 0;
}

.home-summary-section {
  margin-top: 18px;
}

.home-copyright-section {
  margin-top: 18px;
}

.home-copyright-list {
  margin: 12px 0 0;
  padding-left: 40px;
}

.home-copyright-list li {
  padding: 3px 0;
  font-size: 0.94rem;
}

.home-list {
  list-style: disc;
  margin: 12px 0 0;
  padding-left: 40px;
}

.home-list li {
  padding: 3px 0;
  font-size: 0.94rem;
}

.top-nav {
  margin-bottom: 10px;
  font-size: 0.93rem;
  opacity: 0.9;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  text-decoration: underline;
}

.top-nav-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 2px 0;
}

.search-form label {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  opacity: 0.85;
}

.search-form input,
.search-form button {
  font: inherit;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  color: var(--text);
}

.search-form input {
  background: var(--input-bg);
}

.search-form button {
  cursor: pointer;
  background: var(--button-bg);
  color: var(--button-text);
}

.summary {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.82;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-action-btn {
  font: inherit;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.82;
}

.summary-action-btn:hover {
  opacity: 1;
}

.summary-action-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.result-item {
  border-bottom: 1px solid var(--divider);
  padding: 12px 2px;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.history-link {
  text-decoration: none;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0 0 1px;
  font-size: 0.95rem;
  line-height: 1.25;
  opacity: 0.72;
  display: inline-flex;
  align-items: center;
  min-height: 1.25em;
  overflow: visible;
  vertical-align: middle;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.history-link:hover {
  opacity: 1;
}

.result-item:first-child {
  border-top: 1px solid var(--divider);
}

.result-placeholder {
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  padding: 14px 2px;
  font-size: 0.93rem;
  opacity: 0.7;
}

.item-main {
  font-weight: 640;
  text-decoration: none;
  word-break: break-all;
}

.version-list {
  margin-top: 7px;
  font-size: 0.84rem;
  opacity: 0.85;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.version-pill {
  --pill-hue: 220;
  border: 1px solid hsl(var(--pill-hue) 70% 40% / 0.58);
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.25;
  white-space: nowrap;
  background: hsl(var(--pill-hue) 82% 96%);
  color: hsl(var(--pill-hue) 66% 24%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.version-pill-interactive {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.version-pill-interactive:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.version-pill-active {
  border-width: 2px;
  padding: 0 6px;
  opacity: 1;
}

html[data-theme='dark'] .version-pill {
  border: 1px solid hsl(var(--pill-hue) 65% 48% / 0.55);
  background: hsl(var(--pill-hue) 70% 42% / 0.14);
  color: hsl(var(--pill-hue) 80% 75%);
}

html[data-theme='dark'] .version-pill-active {
  border-color: hsl(var(--pill-hue) 88% 68% / 0.95);
  background: hsl(var(--pill-hue) 72% 54% / 0.3);
  box-shadow: 0 0 0 1px hsl(var(--pill-hue) 92% 78% / 0.22);
}

.version-pill-part {
  display: inline-flex;
  align-items: center;
}

.version-pill-build {
  opacity: 0.92;
}

.version-pill-separator {
  width: 1px;
  height: 0.8em;
  background: currentColor;
  opacity: 0.5;
}

.sep {
  opacity: 0.5;
  padding: 0 4px;
}

.history-item {
  padding: 12px 2px;
}

.history-page .result-item {
  border-bottom: none;
}

.history-page .result-item:first-child {
  border-top: none;
}

.history-page .result-list {
  margin: 0;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-version {
  font-weight: 620;
}

.history-badge {
  border: 1px solid var(--history-chip-border);
  background: var(--history-chip-bg);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-width: 84px;
  text-align: center;
  flex-shrink: 0;
}

.history-added {
  border-color: #31a24c99;
}

.history-removed {
  border-color: #c9505099;
}

.history-changed {
  border-color: #b77f1799;
}

.history-unchanged,
.history-missing {
  border-color: #8885;
}

.history-body {
  margin-top: 8px;
  font-size: 0.88rem;
  opacity: 0.88;
}

.history-value {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--history-chip-border);
  overflow: auto;
  max-height: 240px;
  background: var(--code-bg);
}

.latest-value-block {
  margin-top: 8px;
}

.latest-value {
  max-height: 180px;
}

.version-pill-active-marker {
  margin-left: 2px;
  opacity: 0.78;
  font-size: 0.82em;
  font-weight: 700;
}

.xml-tag {
  color: #7f8ea8;
}

.xml-key {
  color: #af4f4f;
}

.xml-text {
  color: var(--text);
}

html[data-theme='dark'] .xml-tag {
  color: #8ba0c4;
}

html[data-theme='dark'] .xml-key {
  color: #e38b8b;
}

.history-collapsed {
  padding: 12px 2px;
}

.history-collapsed-details {
  border: none;
  border-radius: 0;
  padding: 0;
}

.history-collapsed-summary {
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  opacity: 0.86;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
}

.history-collapsed-summary::-webkit-details-marker {
  display: none;
}

.history-collapsed-summary::marker {
  content: '';
}

.history-collapsed-range {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-collapsed-list {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed var(--history-chip-border);
}

.history-collapsed-entry {
  font-size: 0.84rem;
  opacity: 0.82;
  margin: 2px 0;
}

.theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  border: 1px solid var(--history-chip-border);
  background: var(--history-chip-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.theme-toggle:hover {
  filter: brightness(1.04);
}
