:root {
  --bg: #ffffff;
  --fg: #0b0b0d;
  --muted: #6b6b73;
  --line: rgba(0, 0, 0, 0.12);
  --soft: rgba(0, 0, 0, 0.06);
  --card: #ffffff;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 44px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b0b0d;
  --fg: #f4f4f7;
  --muted: rgba(244, 244, 247, 0.62);
  --line: rgba(244, 244, 247, 0.14);
  --soft: rgba(244, 244, 247, 0.08);
  --card: #0f0f12;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px 10px 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

@supports not (backdrop-filter: blur(10px)) {
  .topbar {
    background: var(--bg);
  }
}

.brand__title {
  font-weight: 650;
  letter-spacing: 0.2px;
  font-size: 16px;
  line-height: 1.15;
}

.brand__meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.meta__dot {
  opacity: 0.7;
}

.topbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main {
  flex: 1;
  padding: 16px 14px 110px 14px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.now {
  padding: 16px;
  display: grid;
  gap: 14px;
}

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

.now__pack {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now__pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.now__lyric {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0.2px;
  font-weight: 650;
}

.now__sub {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.now__title {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.25;
  max-width: 70%;
}

.now__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.prompt {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.prompt__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  user-select: none;
}

.prompt__summary::-webkit-details-marker {
  display: none;
}

.prompt__hint {
  font-size: 11px;
  opacity: 0.7;
}

.prompt__text {
  margin: 10px 0 0 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card) 70%, var(--soft));
  border: 1px solid var(--soft);
}

.now__last {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

.last__label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.last__value {
  margin-top: 2px;
  font-size: 12px;
  color: var(--fg);
}

.last__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

.btn {
  min-height: var(--tap);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  letter-spacing: 0.3px;
  font-size: 12px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  font-weight: 700;
  letter-spacing: 0.6px;
}

.btn--outline {
  border-style: dashed;
  color: var(--muted);
}

.btn--ghost {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn--ghost:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--soft) 70%, transparent);
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 40;
}

.toast__inner {
  max-width: 560px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: 1fr auto;
}

.sheet__backdrop {
  background: rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .sheet__backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.sheet__panel {
  background: var(--bg);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.25);
  max-height: min(82vh, 860px);
  display: grid;
  grid-template-rows: auto 1fr;
}

.sheet__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid var(--line);
}

.sheet__title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.sheet__body {
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom)) 14px;
  overflow: auto;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.row__title {
  font-weight: 650;
  font-size: 14px;
  line-height: 1.2;
}

.row__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.row__lyric {
  font-size: 13px;
  color: var(--fg);
  opacity: 0.92;
  line-height: 1.3;
}

.row__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row__actions .btn {
  min-height: 34px;
}

.muted {
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.kbd {
  font-family: var(--mono);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--soft) 65%, transparent);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.field input[type="file"] {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  background: transparent;
}

