/* ==========================================================================
   瑞亿播放器 · 布局与组件
   ========================================================================== */

.app {
  display: grid;
  grid-template-rows: var(--ry-topbar-h) 1fr auto;
  /* ★ 必须显式写下列轨道。只写 grid-template-rows 时，隐式列是 `auto`，
     其最小值就是 min-content —— 顶栏的 min-content 是 454px（品牌 30 + 导航 266 +
     操作 118 + 间距内边距 40），于是整条轨道连同 .app 一起被撑到 454，
     390 的手机屏就被 body{overflow-x:hidden} 切掉 64px（右侧按钮与「设置」点不到）。
     写成 minmax(0, 1fr) 后轨道听容器的，.nav 上那句 min-width:0 才真正生效。 */
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
  gap: 0;
  position: relative;
}

/* ============================== 顶栏 ============================== */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--ry-border);
  background: color-mix(in srgb, var(--ry-base) 55%, transparent);
  backdrop-filter: blur(var(--ry-blur));
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--ry-accent);
}
.brand__mark svg { width: 100%; height: 100%; }
.brand__name { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
.brand__name em { font-style: normal; color: var(--ry-accent); }

.nav { display: flex; gap: 4px; flex-shrink: 0; }
.nav__item {
  padding: 8px 15px;
  border-radius: var(--ry-radius-pill);
  font-size: 14px;
  color: var(--ry-text-dim);
  transition: color 0.18s, background 0.18s;
  position: relative;
  white-space: nowrap;
}
.nav__item:hover { color: var(--ry-text); background: var(--ry-surface); }
.nav__item.is-active { color: var(--ry-accent); font-weight: 600; }
.nav__item.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -1px;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  border-radius: 2px;
  background: var(--ry-accent);
}

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 36px;
  min-width: 210px;
  border-radius: var(--ry-radius-pill);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  color: var(--ry-text-mute);
  transition: border-color 0.2s, background 0.2s;
}
.search:focus-within { border-color: var(--ry-accent); background: var(--ry-surface-2); }
.search input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  font-size: 13px; color: var(--ry-text);
}
.search input::placeholder { color: var(--ry-text-mute); }
.search svg { width: 15px; height: 15px; flex-shrink: 0; }

.topbar__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--ry-radius-sm);
  color: var(--ry-text-dim);
  position: relative;
  transition: color 0.18s, background 0.18s;
}
.icon-btn:hover { color: var(--ry-text); background: var(--ry-surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn__dot {
  position: absolute; top: 5px; right: 4px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  line-height: 1;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ry-accent-grad);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
  margin-left: 4px;
}

/* ============================== 主体 ============================== */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ry-side-w);
  gap: var(--ry-gap);
  padding: var(--ry-gap);
  min-height: 0;
  overflow: hidden;
}

/* ------------------------------ 舞台 ------------------------------ */
.stage {
  position: relative;
  border-radius: var(--ry-stage-radius);
  overflow: hidden;
  background: #05070c;
  border: 1px solid var(--ry-border);
  box-shadow: var(--ry-shadow);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.stage__media { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__media video,
.stage__media img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #05070c;
}
.stage__poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 0.5s, transform 8s linear;
}
.stage.is-playing .stage__poster { opacity: 0.32; transform: scale(1.06); }

.stage__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4, 8, 16, 0.55) 0%, transparent 22%, transparent 55%, rgba(4, 8, 16, 0.85) 100%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.stage:hover .stage__scrim,
.stage.is-paused .stage__scrim,
.stage:focus-within .stage__scrim { opacity: 1; }

.stage__badge {
  position: absolute; top: 14px; left: 16px;
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 12px;
  border-radius: var(--ry-radius-sm);
  background: rgba(6, 12, 22, 0.62);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ry-border);
  font-size: 12px; color: var(--ry-text-dim);
  z-index: 4;
}
.stage__badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ry-accent);
  box-shadow: 0 0 8px var(--ry-accent);
}
.stage.is-playing .stage__badge .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.stage__tools {
  position: absolute; top: 14px; right: 14px;
  display: flex; gap: 6px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.25s;
}
.stage:hover .stage__tools,
.stage:focus-within .stage__tools { opacity: 1; }
.stage__tool {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--ry-radius-sm);
  background: rgba(6, 12, 22, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ry-border);
  color: var(--ry-text-dim);
  transition: color 0.18s, background 0.18s;
}
.stage__tool:hover { color: var(--ry-accent); background: rgba(6, 12, 22, 0.85); }
.stage__tool svg { width: 16px; height: 16px; }

/* 中央大播放键 */
.stage__center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 76px; height: 76px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: rgba(10, 18, 32, 0.42);
  border: 2px solid var(--ry-accent);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 34px color-mix(in srgb, var(--ry-accent) 45%, transparent);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.24s, background 0.24s;
}
.stage__center svg { width: 30px; height: 30px; margin-left: 3px; }
.stage__center:hover { transform: translate(-50%, -50%) scale(1.1); background: color-mix(in srgb, var(--ry-accent) 26%, transparent); }
.stage.is-playing .stage__center { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(0.7); }
.stage:hover.is-playing .stage__center { opacity: 0; }

/* 底部渐变控制区 */
.stage__bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px 14px;
  z-index: 6;
  display: flex; flex-direction: column; gap: 9px;
  transform: translateY(0);
  transition: transform 0.3s, opacity 0.3s;
}
.stage:not(:hover):not(:focus-within) .stage__bar { transform: translateY(calc(100% - 46px)); }

.progress {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--ry-text-dim);
  font-variant-numeric: tabular-nums;
}
.progress__time { flex-shrink: 0; min-width: 42px; }
.progress__time--end { text-align: right; }

/* 滑块 */
.slider {
  flex: 1;
  height: 20px;
  display: flex; align-items: center;
  cursor: pointer;
  position: relative;
  min-width: 0;
}
.slider__rail {
  width: 100%; height: 4px;
  border-radius: 99px;
  background: var(--ry-surface-3);
  overflow: hidden;
  position: relative;
}
.slider__fill {
  height: 100%;
  border-radius: 99px;
  background: var(--ry-accent-grad);
  width: 0%;
  transition: width 0.06s linear;
}
.slider__knob {
  position: absolute;
  top: 50%; left: 0;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
.slider:hover .slider__knob,
.slider.is-drag .slider__knob { opacity: 1; }
.slider:hover .slider__fill { transition: none; }
.slider--sm .slider__rail { height: 3px; }
.slider--sm .slider__knob { width: 10px; height: 10px; }

.stage__row {
  display: flex; align-items: center; gap: 6px;
}
.ctrl {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--ry-radius-sm);
  color: var(--ry-text-dim);
  transition: color 0.16s, background 0.16s, transform 0.16s;
}
.ctrl:hover { color: var(--ry-text); background: var(--ry-surface-2); }
.ctrl:active { transform: scale(0.92); }
.ctrl svg { width: 17px; height: 17px; }
.ctrl--play {
  width: 36px; height: 36px;
  color: var(--ry-accent-ink);
  background: var(--ry-accent-grad);
  border-radius: 50%;
}
.ctrl--play:hover { color: var(--ry-accent-ink); filter: brightness(1.12); background: var(--ry-accent-grad); }
.ctrl--play svg { width: 19px; height: 19px; }
.ctrl.is-on { color: var(--ry-accent); }

.chip {
  height: 26px; padding: 0 10px;
  border-radius: var(--ry-radius-sm);
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  color: #1b1206;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.chip--ghost {
  background: var(--ry-surface-2);
  color: var(--ry-text-dim);
  border: 1px solid var(--ry-border);
  font-weight: 500;
}
.chip--ghost:hover { color: var(--ry-text); background: var(--ry-surface-3); }
.chip svg { width: 12px; height: 12px; }

.spacer { flex: 1; }

.vol { display: flex; align-items: center; gap: 7px; width: 96px; }
.vol .slider { flex: 1; }

/* 舞台内浮层菜单（画质/设置等） */
.pop {
  position: absolute;
  bottom: 60px;
  min-width: 176px;
  padding: 6px;
  border-radius: var(--ry-radius);
  background: color-mix(in srgb, var(--ry-base) 88%, transparent);
  backdrop-filter: blur(24px);
  border: 1px solid var(--ry-border-strong);
  box-shadow: var(--ry-shadow);
  z-index: 20;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}
.pop.is-open { opacity: 1; transform: none; pointer-events: auto; }
.pop__item {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--ry-radius-sm);
  font-size: 13px;
  color: var(--ry-text-dim);
  text-align: left;
  transition: background 0.14s, color 0.14s;
}
.pop__item:hover { background: var(--ry-surface-2); color: var(--ry-text); }
.pop__item svg { width: 15px; height: 15px; flex-shrink: 0; }
.pop__item .tick { margin-left: auto; color: var(--ry-accent); opacity: 0; }
.pop__item.is-on .tick { opacity: 1; }
.pop__item.is-on { color: var(--ry-text); }
.pop__sep { height: 1px; margin: 5px 8px; background: var(--ry-border); }
.pop__label {
  padding: 6px 10px 4px;
  font-size: 11px;
  color: var(--ry-text-mute);
  letter-spacing: 0.4px;
}

/* 添加地址浮层 */
.pop--addr { left: 16px; bottom: 62px; width: 330px; padding: 14px; }
.pop--addr .field { display: flex; flex-direction: column; gap: 8px; }
.pop--addr input {
  height: 36px; padding: 0 12px;
  border-radius: var(--ry-radius-sm);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  outline: none;
  font-size: 13px;
}
.pop--addr input:focus { border-color: var(--ry-accent); }
.pop__hint { font-size: 11px; color: var(--ry-text-mute); line-height: 1.6; }
.pop__actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  height: 34px; padding: 0 16px;
  border-radius: var(--ry-radius-sm);
  font-size: 13px; font-weight: 600;
  background: var(--ry-surface-2);
  color: var(--ry-text-dim);
  border: 1px solid var(--ry-border);
  transition: all 0.16s;
}
.btn:hover { color: var(--ry-text); background: var(--ry-surface-3); }
.btn--primary {
  background: var(--ry-accent-grad);
  color: var(--ry-accent-ink);
  border-color: transparent;
}
.btn--primary:hover { filter: brightness(1.1); color: var(--ry-accent-ink); }
.btn--block { width: 100%; }
.btn--sm { height: 28px; padding: 0 11px; font-size: 12px; }

/* 提示气泡 */
.toast-wrap {
  position: fixed;
  top: calc(var(--ry-topbar-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 17px;
  border-radius: var(--ry-radius-pill);
  background: color-mix(in srgb, var(--ry-base) 92%, transparent);
  backdrop-filter: blur(20px);
  border: 1px solid var(--ry-border-strong);
  box-shadow: var(--ry-shadow);
  font-size: 13px;
  animation: toastIn 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
  max-width: 78vw;
}
.toast.is-out { animation: toastOut 0.24s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ============================== 播放列表 ============================== */
.side {
  display: flex; flex-direction: column;
  border-radius: var(--ry-stage-radius);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  backdrop-filter: blur(var(--ry-blur));
  min-height: 0;
  overflow: hidden;
}
.side__head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px 12px;
  flex-shrink: 0;
}
.side__title { font-size: 15px; font-weight: 700; }
.side__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.side__act {
  height: 27px; padding: 0 9px;
  border-radius: var(--ry-radius-sm);
  font-size: 12px;
  color: var(--ry-text-dim);
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.16s;
}
.side__act:hover { color: var(--ry-text); background: var(--ry-surface-2); }
.side__act svg { width: 13px; height: 13px; }
.side__act--accent { color: var(--ry-accent); }

.tabs {
  display: flex; gap: 2px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--ry-border);
  flex-shrink: 0;
}
.tabs__item {
  padding: 6px 12px;
  border-radius: var(--ry-radius-sm);
  font-size: 13px;
  color: var(--ry-text-mute);
  transition: all 0.16s;
}
.tabs__item:hover { color: var(--ry-text-dim); }
.tabs__item.is-active { color: var(--ry-accent); background: var(--ry-surface-2); font-weight: 600; }

.list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}
.item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: var(--ry-radius);
  cursor: pointer;
  position: relative;
  transition: background 0.16s;
  border: 1px solid transparent;
}
.item:hover { background: var(--ry-surface-2); }
.item.is-current {
  background: color-mix(in srgb, var(--ry-accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--ry-accent) 40%, transparent);
}
.item.is-current .item__title { color: var(--ry-accent); }

.item__thumb {
  width: 62px; height: 38px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--ry-surface-2);
  flex-shrink: 0;
  position: relative;
}
.item__thumb--sq { width: 42px; height: 42px; border-radius: 9px; }
.item__dur {
  position: absolute; right: 3px; bottom: 2px;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.item__body { flex: 1; min-width: 0; }
.item__title {
  font-size: 13px;
  color: var(--ry-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.item__meta {
  font-size: 11px;
  color: var(--ry-text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.item__badge {
  padding: 0 5px;
  border-radius: 4px;
  background: var(--ry-surface-3);
  font-size: 10px;
  color: var(--ry-text-dim);
  flex-shrink: 0;
}
.item__more {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--ry-text-mute);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.16s, background 0.16s, color 0.16s;
}
.item:hover .item__more { opacity: 1; }
.item__more:hover { background: var(--ry-surface-3); color: var(--ry-text); }
.item__more svg { width: 15px; height: 15px; }
.item__playing {
  display: flex; align-items: flex-end; gap: 2px;
  height: 13px;
  flex-shrink: 0;
}
.item__playing i {
  width: 2.5px;
  border-radius: 2px;
  background: var(--ry-accent);
  animation: eq 0.9s ease-in-out infinite;
}
.item__playing i:nth-child(1) { height: 40%; animation-delay: -0.2s; }
.item__playing i:nth-child(2) { height: 85%; animation-delay: -0.5s; }
.item__playing i:nth-child(3) { height: 60%; animation-delay: -0.35s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

.list__empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--ry-text-mute);
  font-size: 13px;
  line-height: 2;
}
.list__empty svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.4; display: block; }

.side__foot {
  padding: 9px 14px;
  border-top: 1px solid var(--ry-border);
  font-size: 11px;
  color: var(--ry-text-mute);
  display: flex; gap: 14px;
  flex-shrink: 0;
}

/* ============================== 右键菜单 ============================== */
.ctx {
  position: fixed;
  min-width: 210px;
  padding: 6px;
  border-radius: var(--ry-radius);
  background: color-mix(in srgb, var(--ry-base) 90%, transparent);
  backdrop-filter: blur(26px);
  border: 1px solid var(--ry-border-strong);
  box-shadow: var(--ry-shadow);
  z-index: 300;
  display: none;
  animation: ctxIn 0.14s ease-out;
}
.ctx.is-open { display: block; }
@keyframes ctxIn { from { opacity: 0; transform: scale(0.97); } }
.ctx__item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px;
  border-radius: var(--ry-radius-sm);
  font-size: 13px;
  color: var(--ry-text-dim);
  text-align: left;
  transition: background 0.13s, color 0.13s;
}
.ctx__item:hover { background: var(--ry-surface-2); color: var(--ry-text); }
.ctx__item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.ctx__item .arrow { margin-left: auto; opacity: 0.6; }
.ctx__item--danger:hover { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.ctx__sep { height: 1px; margin: 5px 9px; background: var(--ry-border); }

/* ============================== 设置抽屉 ============================== */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 396px;
  max-width: 92vw;
  z-index: 250;
  background: color-mix(in srgb, var(--ry-base) 94%, transparent);
  backdrop-filter: blur(30px);
  border-left: 1px solid var(--ry-border-strong);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer__head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ry-border);
  flex-shrink: 0;
}
.drawer__title { font-size: 16px; font-weight: 700; }
.drawer__body { flex: 1; overflow-y: auto; padding: 6px 20px 26px; }

.scrim {
  position: fixed; inset: 0;
  background: rgba(3, 6, 12, 0.55);
  backdrop-filter: blur(3px);
  z-index: 240;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

.sect { padding: 18px 0 4px; }
.sect__title {
  font-size: 12px; font-weight: 700;
  color: var(--ry-text-mute);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 13px;
  display: flex; align-items: center; gap: 8px;
}
.sect__title::after { content: ""; flex: 1; height: 1px; background: var(--ry-border); }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  min-height: 40px;
}
.row__label { flex: 1; font-size: 13.5px; color: var(--ry-text); }
.row__label small { display: block; font-size: 11px; color: var(--ry-text-mute); margin-top: 3px; line-height: 1.5; }
.row__val { font-size: 12.5px; color: var(--ry-text-mute); font-variant-numeric: tabular-nums; }

.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.swatch {
  border-radius: var(--ry-radius);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.18s, transform 0.18s;
  position: relative;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.is-on { border-color: var(--ry-accent); }
.swatch__chip { height: 42px; }
.swatch__name {
  padding: 5px 2px;
  font-size: 11px;
  color: var(--ry-text-mute);
  text-align: center;
  background: var(--ry-surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swatch.is-on .swatch__name { color: var(--ry-accent); }

.seg {
  display: flex;
  padding: 3px;
  border-radius: var(--ry-radius-sm);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  gap: 2px;
}
.seg__item {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ry-text-mute);
  transition: all 0.16s;
  white-space: nowrap;
  padding: 0 6px;
}
.seg__item:hover { color: var(--ry-text-dim); }
.seg__item.is-on {
  background: var(--ry-surface-3);
  color: var(--ry-text);
  font-weight: 600;
}

.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.field__label { font-size: 12.5px; color: var(--ry-text-dim); }
.field input[type="text"],
.field select,
.field textarea {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--ry-radius-sm);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  outline: none;
  font-size: 13px;
  width: 100%;
}
.field textarea { height: auto; padding: 10px 12px; font-family: var(--ry-font-mono); font-size: 12px; line-height: 1.6; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ry-accent); }
.field__hint { font-size: 11px; color: var(--ry-text-mute); line-height: 1.6; }

.gradient-row { display: flex; gap: 8px; align-items: center; }
.gradient-row input[type="color"] {
  width: 40px; height: 36px;
  padding: 2px;
  border: 1px solid var(--ry-border);
  border-radius: var(--ry-radius-sm);
  background: var(--ry-surface);
  cursor: pointer;
}

.upload {
  border: 1.5px dashed var(--ry-border-strong);
  border-radius: var(--ry-radius);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--ry-surface);
}
.upload:hover { border-color: var(--ry-accent); background: var(--ry-surface-2); }
.upload svg { width: 26px; height: 26px; margin: 0 auto 9px; color: var(--ry-accent); }
.upload__t { font-size: 13px; color: var(--ry-text); }
.upload__s { font-size: 11px; color: var(--ry-text-mute); margin-top: 5px; }

.skin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.skin-card {
  border-radius: var(--ry-radius);
  border: 1.5px solid var(--ry-border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--ry-surface);
  position: relative;
}
.skin-card:hover { border-color: var(--ry-border-strong); transform: translateY(-2px); }
.skin-card.is-on { border-color: var(--ry-accent); }
.skin-card__prev {
  height: 74px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.skin-card__prev i {
  position: absolute;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
}
.skin-card__meta { padding: 7px 9px; }
.skin-card__name { font-size: 12px; font-weight: 600; }
.skin-card__tag { font-size: 10px; color: var(--ry-text-mute); margin-top: 2px; }
.skin-card__del {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 0.16s;
}
.skin-card:hover .skin-card__del { opacity: 1; }
.skin-card__del svg { width: 12px; height: 12px; }

.list-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: var(--ry-radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.list-opt:hover { background: var(--ry-surface); }
.list-opt input { accent-color: var(--ry-accent); width: 15px; height: 15px; }
.list-opt__t { font-size: 13px; }
.list-opt__d { font-size: 11px; color: var(--ry-text-mute); margin-top: 2px; }
.list-opt kbd {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--ry-surface-2);
  border: 1px solid var(--ry-border);
  font-family: var(--ry-font-mono);
  font-size: 11px;
  color: var(--ry-text-dim);
}

/* 开关 */
.switch {
  width: 42px; height: 24px;
  border-radius: 99px;
  background: var(--ry-surface-3);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.switch.is-on { background: var(--ry-accent); }
.switch.is-on::after { transform: translateX(18px); }

/* ============================== 音乐模式专属 ============================== */
.app[data-mode="music"] .stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.app[data-mode="music"] .stage__media { position: relative; }

.music-view { display: none; }
.app[data-mode="music"] .video-view { display: none; }
.app[data-mode="music"] .music-view { display: contents; }

@media (max-width: 1080px) {
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .side { max-height: 210px; }
  .search { min-width: 0; width: 150px; }
  .nav__item { padding: 8px 10px; font-size: 13px; }
}

@media (max-width: 760px) {
  :root { --ry-side-w: 100%; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand__name, .search { display: none; }
  .app[data-mode="music"] .stage { grid-template-columns: minmax(0, 1fr); }

  /* ★ 手机顶栏：必须在 .nav 上开一个「收得下去」的出口。
     实测 min-content = 442px（品牌 30 + 导航 246 + 操作 122 + 间距与内边距），
     430 的手机屏装不下 —— 而 body{overflow-x:hidden} 不会给滚动条，
     它只是把右侧 12~182px **切掉**，于是「设置」和右侧按钮在手机上点不到。
     做法：导航是可收缩项（flex:1 1 auto + min-width:0），并在自己内部横向滚动。
     别改成 overflow:hidden —— 那会变成「滑不动也点不到」，比现在更糟。 */
  .nav {
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav__item { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }
  /* 导航开始横向滚动后，激活下划线原本的 bottom:-1px 会被裁掉（active 态就看不见了） */
  .nav__item.is-active::after { bottom: 0; }
  .topbar__actions { flex: 0 0 auto; gap: 4px; }
}
