html, body {
  width: 360px;
  max-height: 600px;
  overflow: hidden;
}

.root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

body {
  margin: 0;
  padding: 12px;
  width: 360px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0c111d;
  color: #f5f7ff;
  display: flex;
  flex-direction: column;
}

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

.branding {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.branding:link,
.branding:visited,
.branding:hover,
.branding:active {
  color: inherit;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-link {
  color: #8aa9ff;
  font-size: 12px;
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid #2a3146;
  border-radius: 6px;
  background: #111827;
}

.header-link:link,
.header-link:visited,
.header-link:hover,
.header-link:active {
  color: #8aa9ff;
  text-decoration: none;
}

.header-link:hover { text-decoration: none; background: #1b2337; }

.logo {
  font-size: 16px;
  font-weight: 600;
}

.logo-image {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.player {
  padding: 8px 10px;
  border-radius: 10px;
  background: #0f172a;
  margin-bottom: 12px;
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 6px 16px rgba(12, 18, 36, 0.45);
}

/* Developer diagnostics log under the player (non-intrusive) */
.dev-log {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  line-height: 1.4;
  color: #9fb4ff;
  background: rgba(17, 24, 39, 0.6);
  border: 1px dashed rgba(96, 165, 250, 0.35);
  border-radius: 8px;
  padding: 6px 8px;
  max-height: 200px;
  overflow-y: auto;
}
.dev-log__body { display: block; }
.dev-log.collapsed { max-height: 40px; overflow: hidden; }
.dev-log.collapsed .dev-log__body { display: none; }
.dev-log__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.dev-log__title { font-size: 10px; color: #c7d2fe; }
.dev-log__button { font-size: 10px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(96,165,250,0.35); background: #111827; color: #e5edff; cursor: pointer; }
.dev-log__button:hover { background: #1b2337; }
.dev-log__line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Empty subscriptions overlay on player */
.player-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(0deg, rgba(12, 17, 29, 0.92), rgba(12, 17, 29, 0.75));
  border: 1px dashed rgba(96, 165, 250, 0.35);
  z-index: 15;
  backdrop-filter: blur(1px);
}
.player-empty-content { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.player-empty-title { margin: 0; font-size: 13px; color: #c7d2fe; }
.player-empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,0.55);
  background: rgba(17, 24, 39, 0.6);
  color: #e5edff;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.player-empty-action:link,
.player-empty-action:visited,
.player-empty-action:hover,
.player-empty-action:active {
  color: #e5edff;
  text-decoration: none;
}
.player-empty-action:hover { background: rgba(37, 99, 235, 0.28); border-color: rgba(96,165,250,0.75); transform: translateY(-1px); }

.placeholder {
  margin: 0;
  font-size: 13px;
  color: #a8b2d2;
}

.content-panel { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.content-panel { scrollbar-width: none; }
.content-panel::-webkit-scrollbar { width: 0; height: 0; }

.player-status-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -12px);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #e5edff;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 320px;
  line-height: 1.4;
  text-align: center;
  z-index: 30;
}
.player-status-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.player-status-toast.error {
  background: rgba(239, 68, 68, 0.92);
  border-color: rgba(248, 113, 113, 0.85);
  color: #fff5f5;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.switcher-button {
  flex: 1 1 auto;
  padding: 6px 0;
  border-radius: 8px;
  border: 1px solid #2a3146;
  background: #111827;
  color: #d6dcff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switcher-button:hover {
  background: #1b2337;
}

.switcher-button.is-active {
  background: rgba(37, 99, 235, 0.3);
  border-color: rgba(96, 165, 250, 0.6);
  color: #f8fafc;
}

.latest-section,
.queue-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}



.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-meta {
  margin: 0;
  font-size: 11px;
  color: #8ea2d8;
}

.small-toggle {
  padding: 2px 8px;
  border: 1px solid #2a3146;
  border-radius: 999px;
  background: #111827;
  color: #c7d2fe;
  font-size: 11px;
  cursor: pointer;
}

.small-toggle:hover { background: #1b2337; }

/* Compact player styles matching the provided design */
.player-compact { display: flex; align-items: center; gap: 10px; }
.pc-cover { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #111827; box-shadow: 0 4px 10px rgba(7, 10, 20, 0.45); }
.pc-cover--placeholder { display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #e5edff; background: linear-gradient(135deg, rgba(59,130,246,0.45), rgba(29,78,216,0.75)); }
.pc-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.pc-title { font-size: 13px; font-weight: 600; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-sub { font-size: 11px; color: #9ca3af; }
.pc-actions { display: flex; align-items: center; gap: 8px; }
.round-icon { width: 34px; height: 34px; border-radius: 999px; border: 1px solid rgba(96,165,250,0.35); background: #1b2337; color: #dbeafe; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.round-icon:hover { background: rgba(30,64,175,.4); transform: translateY(-1px); }
.round-icon::before { content: attr(data-icon); font-size: 15px; line-height: 1; }
.round-icon[disabled] { opacity: 0.4; cursor: default; filter: grayscale(30%); }
.round-icon[disabled]:hover { background: #1b2337; transform: none; }
.round-icon.is-active { background: rgba(37, 99, 235, 0.65); border-color: rgba(96, 165, 250, 0.75); box-shadow: 0 0 12px rgba(96, 165, 250, 0.45); color: #f8fafc; transform: translateY(-0.5px); }
.round-icon.is-active:hover { background: rgba(59, 130, 246, 0.75); }
.pc-progress { margin-top: 6px; height: 3px; background: rgba(71,85,105,0.55); border-radius: 999px; overflow: hidden; cursor: pointer; user-select: none; touch-action: none; position: relative; }
.pc-progress__bar { height: 100%; width: 0%; background: linear-gradient(90deg, #60a5fa, #38bdf8); }
.pc-progress.pc-progress--scrubbing { background: rgba(100,116,139,0.6); }
.pc-progress__bar { height: 100%; width: 0%; background: linear-gradient(90deg, #60a5fa, #38bdf8); }
.pc-controls { margin-top: 10px; display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 10px; }
.pc-controls__rate { justify-self: start; }
.pc-controls__right { justify-self: end; display: inline-flex; gap: 8px; }

.player-wrapper { display: flex; flex-direction: column; gap: 12px; }
.player-body { display: flex; gap: 12px; align-items: center; }
.player-cover-link { display: inline-flex; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 20px rgba(7, 10, 20, 0.6); width: 60px; height: auto; }
.player-cover { width: 100%; height: auto; object-fit: contain; display: block; }
.player-cover--placeholder { display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: #dbeafe; background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(30, 64, 175, 0.8)); border-radius: 12px; width: 60px; height: 30px; box-shadow: 0 8px 20px rgba(7, 10, 20, 0.6); }
.player-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.player-title { font-size: 14px; font-weight: 600; color: #f8fafc; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.player-progress-inline { font-size: 11px; color: #9ca3af; }
.player-progress { height: 6px; background: rgba(71,85,105,0.55); border-radius: 999px; overflow: hidden; cursor: pointer; user-select: none; touch-action: none; position: relative; }
.player-progress__bar { height: 100%; width: 0%; background: linear-gradient(90deg, #60a5fa, #38bdf8); }
.player-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.player-controls__cluster { display: flex; align-items: center; gap: 8px; }
.player-controls__cluster--side:first-of-type { justify-content: flex-start; }
.player-controls__cluster--side:last-of-type { justify-content: flex-end; }
.player-controls__cluster--center { justify-content: center; gap: 12px; }
.player-controls__cluster .player-button { text-align: center; }
.player-button { padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(96, 165, 250, 0.45); background: rgba(17, 24, 39, 0.6); color: #dbeafe; font-size: 12px; cursor: pointer; transition: background 0.15s ease, transform 0.15s ease; font-weight: 600; }
.player-button:hover { background: rgba(30, 64, 175, 0.35); transform: translateY(-1px); }
.player-button[disabled] { opacity: 0.45; cursor: default; }
.player-button--primary { font-weight: 600; background: rgba(59, 130, 246, 0.45); border-color: rgba(96, 165, 250, 0.75); color: #f8fafc; font-size: 18px; width: 48px; height: 48px; padding: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.player-button--primary:hover { background: rgba(59, 130, 246, 0.6); }
.player-button--ghost { background: rgba(17, 24, 39, 0.4); border-color: rgba(96, 165, 250, 0.25); color: #d1ddff; padding: 0; width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.player-controls__cluster--side .player-button--ghost { width: auto; height: auto; padding: 6px 12px; border-radius: 12px; }
.player-button--ghost:hover { background: rgba(37, 99, 235, 0.25); }
.player-button--ghost.is-active { background: rgba(59, 130, 246, 0.28); border-color: rgba(96, 165, 250, 0.65); color: #f8fafc; }

.episode-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.episode-feed.has-footer { padding-bottom: 40px; }
.episode-feed { scrollbar-width: none; }
.episode-feed::-webkit-scrollbar { width: 0; height: 0; }
.list-sentinel {
  margin: 12px auto 8px;
  padding: 4px 0 8px;
  font-size: 11px;
  color: #aeb8d2;
  text-align: center;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}
.list-sentinel.is-disabled { color: #8a95b8; opacity: 0.75; }

.episode-feed__footer {
  margin: 8px auto 4px;
  font-size: 11px;
  color: #7f8ab5;
  text-align: center;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(13, 20, 36, 0.92);
  border: 1px solid rgba(63, 78, 110, 0.45);
  position: relative;
}

.episode-card__cover-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.episode-card__cover-btn:focus-visible {
  outline: 2px solid rgba(96,165,250,0.75);
  outline-offset: 2px;
}

.episode-card__cover {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 6px 16px rgba(7, 11, 20, 0.5);
}

.episode-card__cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #cbd5f5;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(29, 78, 216, 0.75));
}

.episode-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  position: relative;
}

.episode-card__podcast {
  font-size: 12px;
  color: #a5b4fc;
}

.episode-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-card__duration {
  margin-top: 2px;
  font-size: 12px;
  color: #9ca3af;
}

.episode-card__badge {
  font-size: 11px;
  color: #bbf7d0;
}

.episode-card__description {
  display: none;
}

.episode-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: #94a3b8; }
.episode-card__meta-item { display: inline-flex; align-items: center; }
.episode-card__meta-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }

.episode-card__content {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.episode-card__content .episode-card__info {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.episode-card__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
}

/* Play button with progress ring for queue list */
.icon-button.play-button { position: relative; }
/* 取消播放按钮外圈进度环，避免出现被拉伸的圆圈背景 */
.icon-button.play-button::after,
.round-icon.play-button::after {
  content: none !important;
  display: none !important;
}

/* smaller round buttons for list */
.round-icon--sm { width: 28px; height: 28px; }

.episode-card--current {
  border-color: rgba(63, 78, 110, 0.45);
  box-shadow: none;
}

/* Queue specific shrink styles */
.episode-card--queue { padding: 6px 10px; gap: 8px; }
.episode-card--queue .episode-card__cover { width: 52px; height: 52px; border-radius: 8px; box-shadow: none; }
.episode-card--queue .episode-card__podcast { display: none; }
.episode-card--queue .episode-card__actions { margin-left: auto; }
.episode-card--queue.is-dragging { opacity: 0.6; }
.episode-card--queue.is-drag-overlay { box-shadow: 0 12px 24px rgba(15, 23, 42, 0.45); }
.episode-card--queue.is-drop-target { border-style: dashed; border-color: rgba(96, 165, 250, 0.6); background: rgba(30, 41, 59, 0.6); }
.queue-card__drag-area { display: flex; align-items: center; gap: 8px; cursor: grab; user-select: none; }
.queue-card__drag-area:active { cursor: grabbing; }
.queue-card__drag-area .drag-handle {
  width: 18px;
  height: 40px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.22);
  color: #cfe0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
  margin-right: 0;
}
.queue-card__drag-area .drag-handle:hover { background: rgba(59, 130, 246, 0.25); color: #dbeafe; }
.queue-card__drag-area .drag-handle:active { background: rgba(59, 130, 246, 0.35); }
.episode-card--queue.is-dragging .drag-handle { cursor: grabbing; }

/* Latest list compaction */
.episode-card--latest { padding: 8px 12px; gap: 10px; }
.episode-card--latest .episode-card__cover { width: 52px; height: 52px; border-radius: 8px; box-shadow: none; }
.episode-card--latest .episode-card__podcast,
.episode-card--latest .episode-card__duration { display: none; }
.episode-card--latest .episode-card__actions { margin-left: auto; }
.empty-hint {
  font-size: 12px;
  color: #7f8ab5;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(17, 24, 39, 0.6);
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.icon-button--sm { width: 28px; height: 28px; }

.hover-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hover-action-btn__icon {
  font-size: 18px;
  line-height: 1;
}
.hover-action-btn__icon--text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.hover-action-btn:hover,
.hover-action-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);
  outline: none;
}

.hover-action-btn--sm {
  width: 24px;
  height: 24px;
  border-width: 1px;
  font-size: 0;
}
.hover-action-btn--sm .hover-action-btn__icon { font-size: 12px; }
.hover-action-btn--sm:hover,
.hover-action-btn--sm:focus-visible {
  transform: translateY(-1px) scale(1.35);
}

.hover-action-btn--play {
  border-color: rgba(74, 222, 128, 0.65);
  color: #4ade80;
  background: rgba(22, 163, 74, 0.15);
}
.hover-action-btn--play:hover,
.hover-action-btn--play:focus-visible {
  border-color: rgba(74, 222, 128, 0.85);
}

.hover-action-btn--queue {
  border-color: rgba(125, 211, 252, 0.65);
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.18);
}
.hover-action-btn--queue:hover,
.hover-action-btn--queue:focus-visible {
  border-color: rgba(125, 211, 252, 0.85);
}

.hover-action-btn--return {
  border-color: rgba(250, 204, 21, 0.65);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
}
.hover-action-btn--return:hover,
.hover-action-btn--return:focus-visible {
  border-color: rgba(250, 204, 21, 0.85);
}

.hover-action-btn--remove {
  border-color: rgba(248, 113, 113, 0.65);
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}
.hover-action-btn--remove:hover,
.hover-action-btn--remove:focus-visible {
  border-color: rgba(248, 113, 113, 0.85);
}

.drag-handle {
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7183a8;
  cursor: grab;
  user-select: none;
}

.more-menu {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  border: 1px solid rgba(63,78,110,0.55);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
}

.more-menu[hidden] { display: none; }

.more-menu button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(63,78,110,0.35);
  background: #111827;
  color: #e5edff;
  font-size: 12px;
  cursor: pointer;
}

.more-menu button:hover { background: #1b2337; }

.icon-button::before {
  content: attr(data-icon);
  font-size: 14px;
  line-height: 1;
}

.icon-button:hover {
  background: rgba(30, 64, 175, 0.32);
  transform: translateY(-1px);
}
@font-face {
  font-family: 'xyz-iconfont';
  src: url('../assets/iconfont.woff2') format('woff2'),
       url('../assets/iconfont.woff') format('woff'),
       url('../assets/iconfont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.iconfont {
  font-family: 'xyz-iconfont' !important;
  font-style: normal;
  font-weight: normal;
  display: inline-block;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
