:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #211d36;
  background: #141329;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #605b73;
  --line: #e2dff0;
  --violet: #5435bd;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 6%, #302654 0%, transparent 58%),
    #141329;
}

.topbar {
  max-width: 74rem;
  margin-inline: auto;
  padding: 1.35rem clamp(1rem, 4.3vw, 3.1rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.66rem;
  color: #f8f6ff;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.playlist-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  justify-content: start;
  align-content: center;
  gap: 3px;
  padding-left: 0.49rem;
  border: 1px solid #b6a6fc66;
  border-radius: 0.6rem;
  background: #ad97ff24;
}

.playlist-icon i {
  display: block;
  width: 0.9rem;
  height: 2px;
  border-radius: 2px;
  background: #cdbfff;
}

.playlist-icon i:last-child { width: 0.62rem; }

.language {
  display: flex;
  align-items: center;
  gap: 0.16rem;
  padding: 0.23rem;
  border: 1px solid #faf6ff25;
  border-radius: 0.72rem;
  background: #120e2b5c;
}

button, input { font: inherit; }

button {
  border: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 650;
}

button:focus-visible, input:focus-visible {
  outline: 3px solid #9a79fd;
  outline-offset: 3px;
}

.language button {
  min-height: 2.12rem;
  padding-inline: 0.62rem;
  border-radius: 0.45rem;
  color: #e4dbfa;
  background: transparent;
  white-space: nowrap;
}

.language button[aria-pressed="true"] {
  color: #211838;
  background: #eee6ff;
}

.language button[aria-pressed="false"]:hover { background: #ffffff17; }

main {
  width: min(100% - 2rem, 43rem);
  margin-inline: auto;
  padding: clamp(2.9rem, 7.5vw, 6rem) 0 2.75rem;
}

.intro {
  margin-bottom: clamp(1.6rem, 4.4vw, 2.7rem);
  text-align: center;
}

h1 {
  margin: 0;
  color: #fbf9ff;
  font-size: clamp(2.45rem, 6.55vw, 4.15rem);
  font-weight: 750;
  line-height: 1.07;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

:lang(zh-Hans) h1 { letter-spacing: -0.03em; }
.accent { color: #c5afff; }

.intro p {
  max-width: 34rem;
  margin: 1.1rem auto 0;
  color: #ded7ef;
  line-height: 1.55;
  text-wrap: pretty;
}

.card {
  padding: clamp(1rem, 4.9vw, 2rem);
  border: 1px solid #f4eeff;
  border-radius: 1.3rem;
  background: #fff;
  box-shadow: 0 1.6rem 4.4rem #09061d50;
}

.input-heading, .result-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem 0.85rem;
}

label { font-weight: 700; }

.example-button {
  min-height: 2.15rem;
  padding: 0.3rem 0.65rem;
  border-radius: 0.45rem;
  color: var(--violet);
  background: #f2edff;
}

.example-button:hover { background: #eae1ff; }

input {
  min-width: 0;
  padding-inline: 0.86rem;
  border: 1px solid var(--line);
  border-radius: 0.66rem;
  color: #211d36;
  background: #fbfaff;
}

#m3u-link {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.55rem;
  direction: ltr;
}

input::placeholder { color: #6d6680; }
input[aria-invalid="true"] { border-color: #bd3251; }

.primary {
  width: 100%;
  min-height: 3.1rem;
  margin-top: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 0.69rem;
  color: #fff;
  background: var(--violet);
  font-size: 1rem;
}

.primary:hover { background: #45299f; }

.results {
  margin-top: 1.45rem;
  padding-top: 1.24rem;
  border-top: 1px solid var(--line);
}

.result-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.result-fields {
  display: grid;
  gap: 0.77rem;
  margin-top: 0.9rem;
}

.result-field label {
  display: block;
  margin-bottom: 0.3rem;
  color: #49415e;
  font-size: 0.875rem;
}

.result-value { display: flex; gap: 0.4rem; }

.result-value input {
  width: 0;
  flex: 1;
  min-height: 2.65rem;
  font-family: ui-monospace, Consolas, monospace;
}

.secondary {
  min-height: 2.6rem;
  padding-inline: 0.65rem;
  border: 1px solid #dcd2fa;
  border-radius: 0.58rem;
  color: #5033a9;
  background: #f8f5ff;
  white-space: nowrap;
}

.secondary:hover { background: #efe7fd; }

.error, .status {
  margin: 0.55rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.error { color: #a62141; }
.status { color: var(--muted); }
.status:empty { margin: 0; }

.privacy {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin: 1.18rem 0 0;
  color: #ded7ef;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.lock-icon {
  position: relative;
  width: 0.8rem;
  height: 0.65rem;
  flex: none;
  margin-top: 0.2rem;
  border: 1.5px solid #c5afff;
  border-radius: 0.15rem;
}

.lock-icon::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 0.41rem;
  height: 0.42rem;
  transform: translateX(-50%);
  border: 1.5px solid #c5afff;
  border-bottom: 0;
  border-radius: 0.35rem 0.35rem 0 0;
  content: "";
}

.clipboard-buffer {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 24rem) {
  .secondary { padding-inline: 0.48rem; }
  .topbar { gap: 0.45rem; }
}
