.device-page .device-wrap {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0 auto;
  padding: 1.25rem 1.15rem 3rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  font-family: 'Outfit', system-ui, sans-serif;
  color: #f0f4ff;
}

/* 顶栏：仅保留返回播放器 */
.device-topbar {
  margin-bottom: 1.25rem;
}

.device-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem 0.45rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8eeff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.device-topbar-back svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.device-topbar-back:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 标题区 */
.device-hero {
  text-align: center;
  margin-bottom: 1.35rem;
}

.device-hero-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(56, 189, 248, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c4d4ff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.device-hero-badge svg {
  width: 28px;
  height: 28px;
}

.device-hero h1 {
  font-size: 1.65rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.device-sub {
  opacity: 0.82;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}

/* 卡片 */
.device-card {
  background: rgba(12, 16, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.2rem 1.25rem 1.35rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  margin-bottom: 1rem;
}

.device-card--prompt {
  text-align: center;
  padding: 2rem 1.5rem;
}

.device-login-text {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  opacity: 0.9;
}

.device-login-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* 账号行 + 操作按钮 */
.device-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.device-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.device-user-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.device-user-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
  margin-bottom: 0.15rem;
}

.device-user-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.device-user-row--readonly {
  align-items: center;
}

.device-user-hint {
  flex: 1 1 100%;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  opacity: 0.6;
  line-height: 1.4;
}

@media (min-width: 480px) {
  .device-user-row--readonly {
    flex-wrap: nowrap;
  }

  .device-user-hint {
    flex: 1;
    margin: 0;
    text-align: right;
  }
}

/* 区块 */
.device-section {
  margin-bottom: 1.35rem;
}

.device-section:last-child {
  margin-bottom: 0;
}

.device-section h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #e8eeff;
}

.device-hint {
  font-size: 0.82rem;
  opacity: 0.75;
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.device-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  font-size: 0.8em;
}

.device-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.device-form input {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
}

.device-form input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.device-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.device-btn-block {
  width: 100%;
}

.device-btn-primary {
  background: linear-gradient(135deg, #facc15, #fbbf24);
  color: #1a1a24;
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.35);
}

.device-btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.device-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.device-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e8eeff;
}

.device-page .auth-msg {
  margin-top: 0.65rem;
  text-align: center;
}

.device-page .auth-msg.ok {
  color: #86efac;
}

/* 绑定列表 */
.bindings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.binding-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 0.88rem;
}

.binding-index {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.binding-body {
  flex: 1;
  min-width: 0;
}

.binding-body strong {
  font-family: ui-monospace, 'Consolas', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.binding-meta {
  opacity: 0.7;
  font-size: 0.76rem;
  margin-top: 0.2rem;
  line-height: 1.4;
}

.binding-item button {
  flex-shrink: 0;
  background: rgba(255, 80, 80, 0.15);
  border: 1px solid rgba(255, 120, 120, 0.35);
  color: #ffb4b4;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
}

.binding-item button:hover {
  background: rgba(255, 80, 80, 0.25);
}

.device-empty {
  opacity: 0.55;
  font-size: 0.88rem;
  text-align: center;
  padding: 1.25rem 0.5rem;
}

.device-help ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.65;
  opacity: 0.85;
}

.status-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  font-size: 0.7rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.status-badge.active {
  background: rgba(80, 200, 120, 0.22);
  color: #8feca8;
}

.status-badge.disabled {
  background: rgba(200, 80, 80, 0.22);
  color: #ffb4b4;
}

/* 修改密码弹窗（设备页） */
.device-page .settings-modal-wrap {
  z-index: 80;
}

.password-modal-dialog {
  max-width: 420px;
}

.password-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.password-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f4f4f5;
}

@media (max-width: 768px) {
  .device-page .device-wrap {
    padding: 1rem 0.9rem 2.5rem;
  }

  .device-hero h1 {
    font-size: 1.4rem;
  }

  .device-card {
    padding: 1rem 1rem 1.15rem;
    border-radius: 16px;
  }

  .binding-item {
    flex-wrap: wrap;
  }

  .binding-item button {
    width: 100%;
    margin-top: 0.25rem;
  }
}

